forked from valfragier16/JavaScript-DOM
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathjs-dom.html
More file actions
38 lines (28 loc) · 970 Bytes
/
js-dom.html
File metadata and controls
38 lines (28 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<title>DOM lab</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#btn1').on("click",function(e){
$('#myImg').toggle('slow');
});
});
</script>
</head>
<body>
<p id="para1" style="color: red; font-size: 40px;">Developers for life!</p>
<p id="Para2"></p>
<img id="myImg" src="http://placeimg.com/200/200/arch" alt="architecture">
<p id="demo"></p>
<button type="button" id="btn1">Show/Hide Image</button>
<script>
function myFunction() {
var x = document.getElementById("myImg").src;
document.getElementById("demo").innerHTML = x;
document.getElementById("para1").style.fontSize = "40px";
}
</script>
</body>
</html>