<html>
<head>
<script language="javascript">
function something(){
document.getElementById("cell_1").innerHTML = "Text modified in the first cell"
document.getElementById("cell_2").innerHTML = "Text modified in the second cell"
}
</script>
</head>
<body>
<table border="1"><tr>
<td id="cell_1">
left cell
</td>
<td id="cell_2">
right cell
</td>
</tr></table>
<a href="javascript:something()">Change Text</a>
</body></html>
Real simple straight forward way. Anyways you can modify more then text there you can even add html. Remember to use single quotes for any html added inside of javascript. Also \ any javascript langauge specific charecters.
Last edited by jeverd01; 08-19-2007 at 07:37 AM.
Reason: Better solution
|