Lecture 26 (WST) - JavaScript (1)
Lecture 26 (WST) - JavaScript (1)
Lecture # 26
Ehtisham Rasheed
2
JavaScript can change HTML Content
• One of many JavaScript HTML methods is getElementById()
• Example
3
JavaScript Can Change HTML Attribute Values
4
More on JavaScript
5
The <script> Tag
6
JavaScript Functions and Events
7
JavaScript Functions and Events
8
External JavaScript
9
JavaScript Output
10
Using InnerHTML
11
Using InnerText
12
Using document.write()
13
Using document.write()
14
Using document.write()
15
Using window.alert()
16
Using console.log()
• For debugging purpose, you can call the console.log() method in the
browser to display data
• F12 on keyboard will activate debugging
• Then select “Console” in the debugging menu
17
Hands on Lab
18