A simple reminder of the simple power of javascript

<html>
<head>
<title>Slabs of HTML</title>
</head>
<body>
<script type=”text/javascript”>
var a = [];
var i = 0;
a[0] = ” <p>here is paragraph ” + i + “</p>”;
a[++i] = ” <p>here is paragraph ” + i + “</p>”;
a[++i] = ” <p>here is paragraph ” + i + “</p>”;
a[++i] = ” <table border=’1′ cellpadding=’5′ cellspacing=’10’>”;
a[++i] = ” <tr>”;
a[++i] = ” <td>This is a cell</td>”;
a[++i] = ” <td>another cell</td>”;
a[++i] = ” </tr>”;
a[++i] = ” <tr>”;
a[++i] = ” <td>This is a cell</td>”;
a[++i] = ” <td>another cell</td>”;
a[++i] = ” </tr>”;
a[++i] = ” <tr>”;
a[++i] = ” <td colspan=’2′ align=’center’>”;
a[++i] = ” <form name=’fred’ action=”>”;
a[++i] = ” <input type=’text’ name=’aTxt’ width=’50’>”;
a[++i] = ” <input type=’button’ value=’click me'” + ” onclick=\”alert(this.form.aTxt.value);\”><br>” ;
a[++i] = ” <input type=’reset’ value=’Reset’>”;
a[++i] = ” </form>”;
a[++i] = ” </td>”;
a[++i] = ” </tr>”;
a[++i] = “</table>”;

var s = a.join(“”);

document.write(s);

</script>
</body>
</html>

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s