slivka.com > Code > Web > HTML tips
This is a very simple web page that illustrates the minimum HTML needed for JavaScript and DHTML.
See this web page in action.
<html>
<head>
<title>Very Simple JavaScript and DHTML Example</title>
<script type="text/javascript">
function DoIt() {
    txt = '<table>\n';
    txt += '<tr> <th>n</th> <th>sqrt(n)</th> <th>2^n</th> </tr>'
    for (n=0; n<20; n++) {
        txt += '<tr> <td>'+n+'</td> <td>'+Math.sqrt(n)+'</td> <td>'+Math.pow(2,n)+'</td> </tr>'
    }
    txt += '</table>';
    pResults.innerHTML = txt; 
}
</script>
</head>
<body>
<input type=button value="do something" onClick="DoIt()"><br>
<b>Results:</b><br>
<span id=pResults></span>
</body>
</html>

Last updated Wednesday, November 28th, 2001.
© 1997-2024 slivka.com. All rights reserved.

Banderooge.com | BenSlivka.com | BenSlivka.net | GarfieldHSF.org | nu1982.org | slivka.org