Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML Markup language - controls appearance & content of a document Javascripts HTML tags trigger function execution events.

Similar presentations


Presentation on theme: "HTML Markup language - controls appearance & content of a document Javascripts HTML tags trigger function execution events."— Presentation transcript:

1 HTML Markup language - controls appearance & content of a document Javascripts HTML tags trigger function execution events

2 function F1(p) { } JS Functions Defined JS Functions Execution Triggered by Events

3 id - uniquely identifies an HTML element used in place of name attribute get E lement B y I d ( id ) - lets you retrieve an HTML element - document.getElementById (id) How to access HTML Elements for processing.value attribute method"DOM'

4 How to use id & getElementById... in tandem To dynamically alter html elements On the client side

5 function F1(p) { } id attribute Hello id = 11 document. getElementById(p). firstChild.data="Goodbye" document. getElementById(p). style.background='tan' Access cell by id 1 st sub-element of Cell Event In Table data onclick="F1(id)" Change attribute

6 document head title cell by id firstChild data text src height Html element could have been an img tag with its attributes DOM Hierarchy

7 function F1(p) { } id = 11 firstChild.src="eagle.gif" document. getElementById(p). 1 st sub-element of Cell Event In Table onclick="F1(id)"


Download ppt "HTML Markup language - controls appearance & content of a document Javascripts HTML tags trigger function execution events."

Similar presentations


Ads by Google