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

Basic Flask web app

 from flask import Flask app = Flask(__name__) #In Flask, URL rules can be added using either the @app.route() decorator or the app.add_url_...