Many a times we have come across situtations like you need to change a html page’s data with a button click dynamically.Sometimes we need need to change the value or heading of an element.Using text boxes are expensive.We can change any text of a html document by referencing its innerHTML method.DOM – Document Object Model provides these facilities.The only requirement is we give a unique id to the html element’s enclosing tags.Which can be a <td>,<tr>,<table> etc.The following code demonstrates the use of DOM model.
click to view code in action / right click,select ’save as’ to download code