We would like to know how to refer to HTML elements by ID.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.6.2.js'></script>
<script type='text/javascript'>
$(window).load(function(){<!-- www . j a va 2s . c o m-->
$(document).ready(function(){
mypara.innerText += " world";
});
});
</script>
</head>
<body>
<p id="mypara">Hello</p>
</body>
</html>
The code above is rendered as follows: