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

Sacred Thought

5 May 2024 Hari Om Verse 50-51, chapter two:  In this chapter two Shree krishna explains a simple way of living. Free from desires and void ...