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

28 April 2024 Today I am going to explain verse 31 - 38 chapter two for you all. There is no opportunity better than a righteous war (सत्य औ...