-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03.output.html
More file actions
executable file
·34 lines (34 loc) · 870 Bytes
/
03.output.html
File metadata and controls
executable file
·34 lines (34 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<title>JS Output</title>
</head>
<body>
<h2>JS Output</h2>
<p>JavaScript does NOT have any built-in print or display functions. <br>JavaScript can "display" data in different ways:</p>
<ul>
<li>Writing into an alert box, using window.alert().</li>
<li>Writing into the HTML output using document.write().</li>
<li>Writing into an HTML element, using innerHTML.</li>
<li>Writing into the browser console, using console.log().</li>
</ul>
<hr>
<h2>Alert</h2>
<p>window.alert(5+6);</p>
<hr>
<h2>Using document.write()</h2>
<p>window.alert(5+6);</p>
<hr>
<h2>Using innerHTML</h2>
<p id="inner"></p>
<hr>
<h2>Using console.log()</h2>
<hr>
<script type="text/javascript">
window.alert(5+6);
document.write(5 + 6);
document.getElementById('inner').innerHTML = 5+6;
console.log(5 + 6);
</script>
</body>
</html>