Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
if (i == 3 ) {
document.write(" The i varible is at 3")
}
if (myRowCounter % 3 == 0) {
// even multiple of three, so do something...
}
document.write('<table>');
document.write('<tr>');
for (i=0; i<Categories.length; i++){
document.write('<td>');
document.write('<img src="image.jpg" width="80"
height="100"><br>');
document.write('<a href="#">'+Categories[i]+'</a><br>');
document.write('</td>');
if ((i % 3) == 2 && (i != Categories.length - 1)) {
document.write('</tr>');
document.write('<tr>');
}
}
document.write('</table>');
document.write('</tr>');
document.write('</table>');
document.write('<p>');
document.write('Hello world!');
document.write('<p>');
var _html = '<p>';
_html += 'Hello world!';
_html += '</p>';
document.write(_html);
<html>
<head>
<title>test</title>
<script type="text/javascript">
// string concatenation
var start1 = new Date();
document.write('<br/>string concatenation start');
var s = "";
for (var x = 0; x < 10000; x++)
s += "<br/>line number " + x;
document.write(s);
var end1 = new Date();
// multiple document.write()
var start2 = new Date();
document.write('<br/>multiple document.write() start');
for (var x = 0; x < 10000; x++)
document.write("<br/>line number " + x);
var end2 = new Date();
// array
var start3 = new Date();
document.write('<br/>array start');
var ar = [];
for (var x = 0; x < 10000; x++)
ar.push("<br/>line number " + x);
document.write( ar.join("") );
var end3 = new Date();
// totals
var time1 = (end1 - start1) / 1000;
var time2 = (end2 - start2) / 1000;
var time3 = (end3 - start3) / 1000;
document.write("<br/>string concatenation: " + time1 + " seconds");
document.write("<br/>multiple document.write(): " + time2 + " seconds");
document.write("<br/>array: " + time3 + " seconds");
</script>
</head>
<body></body>
</html>