Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head><title>untitled</title>
<script type="text/javascript">
// Move ft into the <head> section and you don't need to set it to 1 twice
var ft = 1;
</script>
</head>
<body>
<div id = "moduleX">
<script type="text/javascript">
function runs() {
ft++; // same as ft = ft+1;
}
// You don't need the onload function in this case. runs() gets called as this
// div is loaded
runs();
</script>
</div>
<div id = "moduleY">
<script type="text/javascript">
document.write(ft);
</script>
</div>
</body>
</html>
Bookmarks