Monday, February 26, 2018

JavaScript : getElementById(" ") method

<!DOCTYPE html>
<html>
<body bgcolor="lightblue">

<h1>HAPPY BIRTHDAY YASH 2016 ON YOUR 11th BIRTHDAY</h1>

<p>Some birthday party pics.</p>

<p>You and your friends</p>

<button onclick="document.getElementById('myImage').src='IMG_20161006_200417.jpg'">switch photo</button>

<img id="myImage" src="IMG_20161006_213208.jpg" style="width:300px">

<button onclick="document.getElementById('myImage').src='IMG_20161006_213208.jpg'">switch back</button>
<img id="myImage" src="IMG_20161006_200604.jpg" style="width:300px">

<button onclick="document.getElementById('myImage').src='SINGH_ASHUTOSH.jpg' ">who's behind</button>

</body>
</html>

Thanks
Happy Scripting

No comments:

Post a Comment

What is a data structures

  Data structure is a tool in the hands of a programmer for  storing a large number of data items  in the main memory (RAM) of a computer wh...