Home | Computer Science
3. write a programme using document.getElementById("_ _ _ _ _ _").innerHTML="_ _ _ _ _ _ _ _ "
<html>
<body>




<button onclick="document.getElementById('myImage').src='on.jpg'">Turn on the computer</button>

<img id="myImage" src="off.jpg" style="width:100px">

<button onclick="document.getElementById('myImage').src='off.jpg'">Turn off the computer</button>

</body>
</html>

output:-

16. Write a programme using <script> and lerarn variable declaration
<html> <head>
 <title>javascript</title>
<script>

var x;
let y;

y=9;
x = 6;
let z = x + y;
const a="hello";
const b=8.78;
document.write(x+"  "+y+" " + z+"<br>" +a +"        " + b);
</script>

 </head> <body>
 <p id="demo"></p><p>const , let and var do same work</p> 
  
</body>
 </html>

OUTPUT

5 6 11
11
hello 8.78