simple DOM change
Sample changing the content of the DOM
HTML
<!-- Business Web Technologies -->
<!-- School of Information Systems -->
<!-- Curtin University -->
<!-- Division for content -->
<div id="content">
</div>
JavaScript
// Minimum of two numbers
function minimum(a, b) {
if (a < b)
return a;
else
return b;
}
// Try this:
// Can you edit this JavaScript so that you show the
// minimum of two numbers stored in variables that you
// can will call x and y?
var x =6;
var y =12;
var newContent = "Minimum of 12 and 6 is " + minimum (x, y) + ".";
document.getElementById("content").innerHTML = newContent;