Skip to content

Commit

Permalink
Website Creation Class (Work Files/Project Files)
Browse files Browse the repository at this point in the history
  • Loading branch information
MafuSaku authored Jun 29, 2022
1 parent 500303d commit d102030
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ข้อ2-class.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html>
<body>
<h1>HTML JavaScript</h1>

<button type="button" onclick="document.getElementById('test').innerHTML = Date()">
คลิกที่นี่เพื่อแสดงวันที่และเวลา</button>

<p id="test"></p>
</body>
</html>
24 changes: 24 additions & 0 deletions ข้อ3-class.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html>
<body>
<script>
function light(sw) {
var pic;
if (sw == 0) {
pic = "sollyzgift.png"
} else {
pic = "sundyzgift.png"
}
document.getElementById('myImage').src = pic;
}
</script>

<img id="myImage" src="sollyzfxiivgift.png">

<p>
<button type="button" onclick="light(1)">ภาพ1</button>
<button type="button" onclick="light(0)">ภาพ2</button>
</p>

</body>
</html>
18 changes: 18 additions & 0 deletions ข้อ4-class.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html>
<body>
<h1>My First JavaScript</h1>

<p id="demo">JavaScript can change the style of an HTML element.</p>

<script>
function myFunction() {
document.getElementById("demo").style.fontSize = "25px";
document.getElementById("demo").style.color = "pink";
document.getElementById("demo").style.backgroundColor = "#aec6cf";
}
</script>

<button type="button" onclick="myFunction()">Click Me!</button>
</body>
</html>

0 comments on commit d102030

Please sign in to comment.