Use of innerHTML tag

by Nirmala 2008-10-14 10:34:08

Hi...

By using javascript I want to display some value inside any html element means use the innerHTML tag.
You must set the id for the HTML element by using that id we can set any type of value in javascript function and display it into HTML element.
For Example,
Display strings to table.
<table border=1>
<tr><td id=show>
</td></tr>
</table>
<script type="text/javascript">
function display()
{
var tt="Hi to all";
var disp=document.getElementById('show');
disp.innerHTML=tt;
}
display();
</script>

Tagged in:

1540
like
1
dislike
0
mail
flag

You must LOGIN to add comments