Trigger function from a button in page - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Button

Description

Trigger function from a button in page

Demo Code

ResultView the demo in separate window

<html>
   <head>
      <script language="javascript">
function changeParent() {/*from  w w  w.ja va 2  s. co  m*/
  window.opener.document.getElementById('text1').value="Value changed..";
  window.close();
}

      </script> 
   </head>
   <body> 
      <form> 
         <input type="button" onclick="javascript:changeParent()" value="Change opener's textbox's value.."> 
      </form>  
   </body>
</html>

Related Tutorials