28 lines
930 B
HTML
28 lines
930 B
HTML
|
<html>
|
||
|
<head>
|
||
|
<title>Example 7.12</title>
|
||
|
<script>
|
||
|
function begin()
|
||
|
{
|
||
|
var one = 0; var two = 1; var three = "_"; var four = NaN;
|
||
|
var bool1 = new Boolean(one);
|
||
|
var bool2 = new Boolean(two);
|
||
|
var bool3 = new Boolean(three);
|
||
|
var bool4 = new Boolean(four);
|
||
|
document.getElementById('1').innerHTML = (one + " results in Boolean " + bool1);
|
||
|
document.getElementById('2').innerHTML = (two + " results in Boolean " + bool2);
|
||
|
document.getElementById('3').innerHTML = (three + " results in Boolean " + bool3);
|
||
|
document.getElementById('4').innerHTML = (four + " results in Boolean " + bool4);
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body><table align="center" width = "70%"><tr><td><br />
|
||
|
<input type ="button" onclick="begin()" value = "Check Boolean values"><br />
|
||
|
<h3><span id = "1"> </span></h3>
|
||
|
<h3><span id = "2"> </span></h3>
|
||
|
<h3><span id = "3"> </span></h3>
|
||
|
<h3><span id = "4"> </span></h3>
|
||
|
</td></tr></table>
|
||
|
</body>
|
||
|
</html>
|