SlideShare a Scribd company logo
1 of 12
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
Hidaya Institute of
Science &
Technology
www.histpk.org
A Division of Hidaya Trust, Pakistan
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
JAVASCRIPT
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
DIALOG BOX
Alert Dialog Box:
•An alert dialog box is mostly used to give a warning message to
the users. Like if one input field requires to enter some text but
user does not enter that field then as a part of validation you
can use alert box to give warning message
alert(“text”);
Confirmation Dialog Box:
•A confirmation dialog box is mostly used to take user's consent on any
option. It displays a dialog box with two buttons: OK and Cancel.
•If the user clicks on OK button the window method confirm() will
return true. If the user clicks on the Cancel button confirm() returns
false. You can use confirmation dialog box
confirm(“Message");
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
DIALOG BOX
•Prompt Dialog Box:
•The prompt dialog box is very useful when you want to pop-up
a text box to get user input. Thus it enable you to interact with
the user. The user needs to fill in the field and then click OK.
•This dialog box is displayed using a method
called prompt() which takes two parameters (i) A label which
you want to display in the text box (ii) A default string to display
in the text box.
•This dialog box with two buttons: OK and Cancel. If the user
clicks on OK button the window method prompt() will return
entered value from the text box. If the user clicks on the Cancel
button the window method prompt() returns null.
•prompt(“Message At top", “Name In Field");
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
FUNCTIONS
•A function is a group of reusable code which can be called
anywhere in your program. This eliminates the need of writing
same code again and again.
•Help programmers to write modular code.
•Can easily divide your big program in a number of small and
manageable functions.
•Like any other advance programming language, JavaScript also
supports all the features necessary to write modular code using
functions.
•You must have seen functions like alert() and write(), We are
using these function again and again but they have been written
in core JavaScript only once.
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
FUNCTIONS
•The most common way to define a function in JavaScript is by using
the function keyword, followed by a unique function name, a list of
parameters (that might be empty), and a statement block surrounded
by curly braces.
•The basic syntax is shown here:
function functionname(parameter-list)
{
statements
}
Calling a Function:
•To invoke a function somewhere later in the script, you would simple
need to write the name of that function as follows:
functionname();
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
FUNCTIONS
Function Parameters:
•There is a facility to pass different parameters while calling a function.
•These passed parameters can be captured inside the function and any
manipulation can be done over those parameters.
•A function can take multiple parameters separated by comma.
function functionname(para1,para2)
{
statements
}
The return Statement:
A JavaScript function can have an optional return statement. This is
required if you want to return a value from a function. This statement
should be the last statement in a function.
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
EVENTS IN JAVASCRIPT
•JavaScript's interaction with HTML is handled through events
that occur when the user or browser manipulates a page.
•When the page loads, that is an event.
•When the user clicks a button, that click, too, is an event.
• Another example of events are like:
• pressing any key
• closing window
• resizing window.
•Developers can use these events to execute JavaScript coded
responses, which cause buttons to close windows, messages to
be displayed to users, data to be validated, and virtually any
other type of response imaginable to occur.
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
HTML 4 STANDARD EVENTS
Event Value Description
onchange script Script runs when the element changes
onsubmit script Script runs when the form is submitted
onreset script Script runs when the form is reset
onselect script Script runs when the element is selected
onblur script Script runs when the element loses focus
onfocus script Script runs when the element gets focus
onkeydown script Script runs when key is pressed
onkeypress script Script runs when key is pressed and released
onkeyup script Script runs when key is released
onclick script Script runs when a mouse click
ondblclick script Script runs when a mouse double-click
onmousedown script Script runs when mouse button is pressed
onmousemove script Script runs when mouse pointer moves
onmouseout script Script runs when mouse pointer moves out of an element
onmouseover script Script runs when mouse pointer moves over an element
onmouseup script Script runs when mouse button is released
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
DOCUMENT OBJECT MODEL
•Every web page resides inside a browser window which can be considered as an object.
•A Document object represents the HTML document that is displayed in that window.
•The Document object has various properties that refer to other objects which allow access
to and modification of document content.
•The way that document content is accessed and modified is called the Document Object
Model, or DOM. The Objects are organized in a hierarchy.
• This hierarchical structure applies to the organization of objects in a Web document.
•Window object: Top of the hierarchy. It is the outmost element of the object hierarchy.
•Document object: Each HTML document that gets loaded into a window becomes a
document object. The document contains the content of the page.
•Form object: Everything enclosed in the <form>...</form> tags sets the form object.
•Form control elements: The form object contains all the elements defined for that object
such as text fields, buttons, radio buttons, and checkboxes.
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

More Related Content

Viewers also liked (16)

Javascript lecture 3
Javascript lecture 3Javascript lecture 3
Javascript lecture 3
 
Web forms and html lecture Number 4
Web forms and html lecture Number 4Web forms and html lecture Number 4
Web forms and html lecture Number 4
 
String functions and operations
String functions and operations String functions and operations
String functions and operations
 
Css presentation lecture 4
Css presentation lecture 4Css presentation lecture 4
Css presentation lecture 4
 
Sessions in php
Sessions in php Sessions in php
Sessions in php
 
Functions in php
Functions in phpFunctions in php
Functions in php
 
PHP array 1
PHP array 1PHP array 1
PHP array 1
 
String functions and operations
String functions and operations String functions and operations
String functions and operations
 
Javascript lecture 4
Javascript lecture  4Javascript lecture  4
Javascript lecture 4
 
Form validation with built in functions
Form validation with built in functions Form validation with built in functions
Form validation with built in functions
 
Form validation server side
Form validation server side Form validation server side
Form validation server side
 
loops and branches
loops and branches loops and branches
loops and branches
 
Web forms and html lecture Number 3
Web forms and html lecture Number 3Web forms and html lecture Number 3
Web forms and html lecture Number 3
 
introduction to programmin
introduction to programminintroduction to programmin
introduction to programmin
 
Form validation client side
Form validation client side Form validation client side
Form validation client side
 
Web forms and html lecture Number 2
Web forms and html lecture Number 2Web forms and html lecture Number 2
Web forms and html lecture Number 2
 

Similar to Javascript 2

INTERNSHIP PPT - INFOLABZ.pptx
INTERNSHIP PPT - INFOLABZ.pptxINTERNSHIP PPT - INFOLABZ.pptx
INTERNSHIP PPT - INFOLABZ.pptx
DevChaudhari15
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps Quickly
Gil Irizarry
 
Automation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional TesterAutomation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional Tester
VijayChowthri Nagaprakasham
 

Similar to Javascript 2 (20)

Learn Javascript Basics
Learn Javascript BasicsLearn Javascript Basics
Learn Javascript Basics
 
Hsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfHsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdf
 
INTERNSHIP PPT - INFOLABZ.pptx
INTERNSHIP PPT - INFOLABZ.pptxINTERNSHIP PPT - INFOLABZ.pptx
INTERNSHIP PPT - INFOLABZ.pptx
 
216170316007.pptx
216170316007.pptx216170316007.pptx
216170316007.pptx
 
Google Assistant Revolution
Google Assistant RevolutionGoogle Assistant Revolution
Google Assistant Revolution
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps Quickly
 
Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump Start
 
Free and Open Source Software
Free and Open Source SoftwareFree and Open Source Software
Free and Open Source Software
 
Raja3Years
Raja3YearsRaja3Years
Raja3Years
 
Done in 60 seconds - Creating Web 2.0 applications made easy
Done in 60 seconds - Creating Web 2.0 applications made easyDone in 60 seconds - Creating Web 2.0 applications made easy
Done in 60 seconds - Creating Web 2.0 applications made easy
 
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
 
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
 
MAST Portal: drivers and recommendations
MAST Portal: drivers and recommendations  MAST Portal: drivers and recommendations
MAST Portal: drivers and recommendations
 
Joget Workflow v6 Training Slides - 8 - Designing your First Userview
Joget Workflow v6 Training Slides - 8 - Designing your First UserviewJoget Workflow v6 Training Slides - 8 - Designing your First Userview
Joget Workflow v6 Training Slides - 8 - Designing your First Userview
 
Mychoice -classified site for buying, selling, rent etc
Mychoice -classified site for buying, selling, rent etcMychoice -classified site for buying, selling, rent etc
Mychoice -classified site for buying, selling, rent etc
 
Basic iOS Training with SWIFT - Part 4
Basic iOS Training with SWIFT - Part 4Basic iOS Training with SWIFT - Part 4
Basic iOS Training with SWIFT - Part 4
 
JavaScript: Implementations And Applications
JavaScript: Implementations And ApplicationsJavaScript: Implementations And Applications
JavaScript: Implementations And Applications
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Dom
DomDom
Dom
 
Automation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional TesterAutomation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional Tester
 

More from Mudasir Syed

More from Mudasir Syed (20)

Error reporting in php
Error reporting in php Error reporting in php
Error reporting in php
 
Cookies in php lecture 2
Cookies in php  lecture  2Cookies in php  lecture  2
Cookies in php lecture 2
 
Cookies in php lecture 1
Cookies in php lecture 1Cookies in php lecture 1
Cookies in php lecture 1
 
Ajax
Ajax Ajax
Ajax
 
Reporting using FPDF
Reporting using FPDFReporting using FPDF
Reporting using FPDF
 
Oop in php lecture 2
Oop in  php lecture 2Oop in  php lecture 2
Oop in php lecture 2
 
Oop in php lecture 2
Oop in  php lecture 2Oop in  php lecture 2
Oop in php lecture 2
 
Filing system in PHP
Filing system in PHPFiling system in PHP
Filing system in PHP
 
Time manipulation lecture 2
Time manipulation lecture 2Time manipulation lecture 2
Time manipulation lecture 2
 
Time manipulation lecture 1
Time manipulation lecture 1 Time manipulation lecture 1
Time manipulation lecture 1
 
Php Mysql
Php Mysql Php Mysql
Php Mysql
 
Adminstrating Through PHPMyAdmin
Adminstrating Through PHPMyAdminAdminstrating Through PHPMyAdmin
Adminstrating Through PHPMyAdmin
 
Sql select
Sql select Sql select
Sql select
 
PHP mysql Sql
PHP mysql  SqlPHP mysql  Sql
PHP mysql Sql
 
PHP mysql Mysql joins
PHP mysql  Mysql joinsPHP mysql  Mysql joins
PHP mysql Mysql joins
 
PHP mysql Introduction database
 PHP mysql  Introduction database PHP mysql  Introduction database
PHP mysql Introduction database
 
PHP mysql Installing my sql 5.1
PHP mysql  Installing my sql 5.1PHP mysql  Installing my sql 5.1
PHP mysql Installing my sql 5.1
 
PHP mysql Er diagram
PHP mysql  Er diagramPHP mysql  Er diagram
PHP mysql Er diagram
 
PHP mysql Database normalizatin
PHP mysql  Database normalizatinPHP mysql  Database normalizatin
PHP mysql Database normalizatin
 
PHP mysql Aggregate functions
PHP mysql Aggregate functionsPHP mysql Aggregate functions
PHP mysql Aggregate functions
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

Javascript 2

  • 1. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org Hidaya Institute of Science & Technology www.histpk.org A Division of Hidaya Trust, Pakistan
  • 2. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org JAVASCRIPT
  • 3. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org DIALOG BOX Alert Dialog Box: •An alert dialog box is mostly used to give a warning message to the users. Like if one input field requires to enter some text but user does not enter that field then as a part of validation you can use alert box to give warning message alert(“text”); Confirmation Dialog Box: •A confirmation dialog box is mostly used to take user's consent on any option. It displays a dialog box with two buttons: OK and Cancel. •If the user clicks on OK button the window method confirm() will return true. If the user clicks on the Cancel button confirm() returns false. You can use confirmation dialog box confirm(“Message");
  • 4. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org DIALOG BOX •Prompt Dialog Box: •The prompt dialog box is very useful when you want to pop-up a text box to get user input. Thus it enable you to interact with the user. The user needs to fill in the field and then click OK. •This dialog box is displayed using a method called prompt() which takes two parameters (i) A label which you want to display in the text box (ii) A default string to display in the text box. •This dialog box with two buttons: OK and Cancel. If the user clicks on OK button the window method prompt() will return entered value from the text box. If the user clicks on the Cancel button the window method prompt() returns null. •prompt(“Message At top", “Name In Field");
  • 5. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org FUNCTIONS •A function is a group of reusable code which can be called anywhere in your program. This eliminates the need of writing same code again and again. •Help programmers to write modular code. •Can easily divide your big program in a number of small and manageable functions. •Like any other advance programming language, JavaScript also supports all the features necessary to write modular code using functions. •You must have seen functions like alert() and write(), We are using these function again and again but they have been written in core JavaScript only once.
  • 6. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org FUNCTIONS •The most common way to define a function in JavaScript is by using the function keyword, followed by a unique function name, a list of parameters (that might be empty), and a statement block surrounded by curly braces. •The basic syntax is shown here: function functionname(parameter-list) { statements } Calling a Function: •To invoke a function somewhere later in the script, you would simple need to write the name of that function as follows: functionname();
  • 7. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org FUNCTIONS Function Parameters: •There is a facility to pass different parameters while calling a function. •These passed parameters can be captured inside the function and any manipulation can be done over those parameters. •A function can take multiple parameters separated by comma. function functionname(para1,para2) { statements } The return Statement: A JavaScript function can have an optional return statement. This is required if you want to return a value from a function. This statement should be the last statement in a function.
  • 8. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org EVENTS IN JAVASCRIPT •JavaScript's interaction with HTML is handled through events that occur when the user or browser manipulates a page. •When the page loads, that is an event. •When the user clicks a button, that click, too, is an event. • Another example of events are like: • pressing any key • closing window • resizing window. •Developers can use these events to execute JavaScript coded responses, which cause buttons to close windows, messages to be displayed to users, data to be validated, and virtually any other type of response imaginable to occur.
  • 9. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org HTML 4 STANDARD EVENTS Event Value Description onchange script Script runs when the element changes onsubmit script Script runs when the form is submitted onreset script Script runs when the form is reset onselect script Script runs when the element is selected onblur script Script runs when the element loses focus onfocus script Script runs when the element gets focus onkeydown script Script runs when key is pressed onkeypress script Script runs when key is pressed and released onkeyup script Script runs when key is released onclick script Script runs when a mouse click ondblclick script Script runs when a mouse double-click onmousedown script Script runs when mouse button is pressed onmousemove script Script runs when mouse pointer moves onmouseout script Script runs when mouse pointer moves out of an element onmouseover script Script runs when mouse pointer moves over an element onmouseup script Script runs when mouse button is released
  • 10. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org DOCUMENT OBJECT MODEL •Every web page resides inside a browser window which can be considered as an object. •A Document object represents the HTML document that is displayed in that window. •The Document object has various properties that refer to other objects which allow access to and modification of document content. •The way that document content is accessed and modified is called the Document Object Model, or DOM. The Objects are organized in a hierarchy. • This hierarchical structure applies to the organization of objects in a Web document. •Window object: Top of the hierarchy. It is the outmost element of the object hierarchy. •Document object: Each HTML document that gets loaded into a window becomes a document object. The document contains the content of the page. •Form object: Everything enclosed in the <form>...</form> tags sets the form object. •Form control elements: The form object contains all the elements defined for that object such as text fields, buttons, radio buttons, and checkboxes.
  • 11. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
  • 12. © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org