Referring to HTML elements in Javascript by their ID - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

Referring to HTML elements in Javascript by their ID

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.2.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/* w ww . ja  v a  2  s.c om*/
$(document).ready(function(){
     mypara.innerText += " world";
});
    });

      </script> 
   </head> 
   <body> 
      <p id="mypara">Hello</p>  
   </body>
</html>

Related Tutorials