SlideShare a Scribd company logo
Cascade Style Sheet & Java Script & DOM By:  Mr. PHUPHA PUNYAPOTASAKUL ( ภูผา ปัญญาโพธาสกุล )
C ascading  S tyle  S heets CSS  stands for  C ascading  S tyle  S heets  Styles define  how to display  HTML elements  Styles were added to HTML 4.0  to solve a problem  External Style Sheets  can save a lot of work  Multiple style definitions will  cascade  into one
Cascading Order Browser default   External style sheet   Internal style sheet  ( inside the <head> tag )  Inline style  ( inside an HTML element )
CSS Syntax Syntax selector {property :  value}   E.g. body {color :  black}   If   value have space or special character p {font - family : &quot; sans serif &quot; }
CSS Syntax Multiple properties (use semi-colon) p { text-align: center; color: black; font-family: arial }   Grouping h1,h2,h3,h4,h5,h6 { color :  green }
CSS Syntax Class selector p.right {text-align: right} p.center {text-align: center} … <p class=&quot;right&quot;>   ..</p> Applying more than one class <p class=&quot;center bold&quot;>   .. </p> Class for any tag .right {text-align: right}
CSS Syntax ID Selector #green {color :  green}   ID Selector for specific tag p#green {color :  green} Applying style <p id=“green”>   .. </p> Tag with specific attribute input [ type =&quot; text &quot;]  {background - color :  blue}
CSS Comment Start with /* and end with */ Similar to C or JAVA E.g. /* This is a comment */ p { text-align: center; /* This is another comment */ color: black; font-family: arial }
CSS Pseudo-classes Syntax selector:pseudo-class {property: value}   selector.class:pseudo-class {property: value}   E.g. a : link {color :  #FF0000}  /*  unvisited link  */  a : visited {color :  #00FF00}  /*  visited link  */ a : hover {color :  #FF00FF}  /*  mouse over link  */ a : active {color :  #0000FF}  /*  selected link  */ a . red : visited {color :  #FF0000}
Dreamweaver
CCS Windows
Box model
Java Script JavaScript was designed to add interactivity to HTML pages   JavaScript is a scripting language   A scripting language is a lightweight programming language   A JavaScript consists of lines of executable computer code   A JavaScript is usually embedded directly into HTML pages   JavaScript is an interpreted language  ( means that scripts execute without preliminary compilation )  Everyone can use JavaScript without purchasing a license
Java Script Basic Most of syntax same as JAVA Some JAVA feature was cut out e.g. public protected static etc. Case sensitive Interpreted language not compiled language Flexible data type
Variables Syntax example var strname  = &quot; Hege &quot;  Variable scope Local: declared within a function Global: elsewhere Overriding global variable Implicit declaration
Arithmetic Operators Decrement -- Increment ++ Modulus (division remainder)  % Division  / Multiplication  * Subtraction  - Addition  + Description Operator
Assignment Operators x=x%y x%=y  %= x=x/y x/=y  /= x=x*y  x*=y  *= x=x-y  x-=y  -= x=x+y  x+=y  += x=y x=y = Is The Same As Example Operator
Comparison Operators   is less than or equal to  <= is greater than or equal to  >= is less than  < is greater than  > is not equal  != is equal to (checks for both value and type) === is equal to  == Description Operator
Flow control If then else Switch For loop While loop Break/continue statement
Arrays Creating an array var mycars=new Array() ; var mycars=new Array(3) ; var mycars=new Array(&quot;Saab&quot;,&quot;Volvo&quot;,&quot;BMW&quot;) ; Accessing value in array alert( mycars[0]  ); Dynamic length Flexible data type
Basic Function alert(“some text”); confirm(“some text”); Return true/false prompt(“some text”,”default value”); Return user’s inputted value
Java Script Object Contains information about the current URL Location Contains the visited URLs in the browser window History Contains information about the client's display screen Screen Contains information about the client's browser Navigator The top level object in the JavaScript hierarchy. The Window object represents a browser window. A Window object is created automatically with every instance of a <body> or <frameset> tag Window Description Object
Events Examples of events : A mouse click   A web page or an image loading   Mousing over a hot spot on the web page   Selecting an input box in an HTML form   Submitting an HTML form   A keystroke
HTML Event onload and onUnload onFocus, onBlur and onChange onSubmit onMouseOver and onMouseOut And etc. Invoking Java Script function <input type =&quot; text &quot;  size =&quot; 30 &quot;  id =&quot; email &quot;  onchange =&quot; checkEmail ()&quot; >
HTML DOM The DOM (Document Object Model) presents an HTML document as a tree - structure  ( a node tree ) , with elements, attributes, and text .
DOM Inspector
Access Node Get element by ID document.getElementById('someID')   Get element by tag name document.getElementsByTagName(&quot;p&quot;)   Return value possible to be either object or array of object parentNode, firstChild, lastChild  and etc.
Question & Answer

More Related Content

What's hot (20)

PDF
JavaScript DOM & event
Borey Lim
 
PPT
Javascript 2009
borkweb
 
PPTX
JavaScript and jQuery Basics
Kaloyan Kosev
 
PPTX
Java Script
Dr. SURBHI SAROHA
 
PDF
Introduction to HTML, CSS, and Javascript
Agustinus Theodorus
 
PPT
Learn javascript easy steps
prince Loffar
 
PPT
Html JavaScript and CSS
Radhe Krishna Rajan
 
PPT
Java script
Soham Sengupta
 
PPTX
1. java script language fundamentals
Rajiv Gupta
 
PPTX
CSC103 Web Technologies: HTML, CSS, JS
Richard Homa
 
PDF
Devoxx 2014-webComponents
Cyril Balit
 
PDF
22 j query1
Fajar Baskoro
 
PPTX
jQuery Presentation
Rod Johnson
 
PPT
Java script
vishal choudhary
 
PPT
Java script Learn Easy
prince Loffar
 
PDF
Javascript
Rajavel Dhandabani
 
PPTX
Introduction to jQuery
Gunjan Kumar
 
PPT
Javascript by geetanjali
Geetanjali Bhosale
 
PPTX
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
PPTX
Javascript
D V BHASKAR REDDY
 
JavaScript DOM & event
Borey Lim
 
Javascript 2009
borkweb
 
JavaScript and jQuery Basics
Kaloyan Kosev
 
Java Script
Dr. SURBHI SAROHA
 
Introduction to HTML, CSS, and Javascript
Agustinus Theodorus
 
Learn javascript easy steps
prince Loffar
 
Html JavaScript and CSS
Radhe Krishna Rajan
 
Java script
Soham Sengupta
 
1. java script language fundamentals
Rajiv Gupta
 
CSC103 Web Technologies: HTML, CSS, JS
Richard Homa
 
Devoxx 2014-webComponents
Cyril Balit
 
22 j query1
Fajar Baskoro
 
jQuery Presentation
Rod Johnson
 
Java script
vishal choudhary
 
Java script Learn Easy
prince Loffar
 
Javascript
Rajavel Dhandabani
 
Introduction to jQuery
Gunjan Kumar
 
Javascript by geetanjali
Geetanjali Bhosale
 
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Javascript
D V BHASKAR REDDY
 

Viewers also liked (20)

PPT
Aubergine Parmigiana - Recipe
Tiina Sarisalmi
 
PPT
Prezentacja Gimnazjum Integracyjnego
zuza94
 
PDF
Sustainable and Responsible Investing
Scott Sadler
 
PDF
Long Life Bicycles
Silen disco
 
PPT
Google Wave og Wolfram Alpha
carstenhp
 
PPT
KMUTNB - Internet Programming 5/7
phuphax
 
PPT
Oriveden Keskuskoulu - Christmas Greeting from Preschool
Tiina Sarisalmi
 
PPS
Idea
guest4570edb
 
PPT
Tactiek verdedigen
Johanda
 
PPT
Student Investment Fund
skyguy102
 
KEY
Denver Green Car Presentation
banovsky
 
PPT
eTwinning - lyhyt johdatus työpajatyöskentelyyn
Tiina Sarisalmi
 
PDF
One Source Solutions
scaster
 
PPT
Juliana New York
guest3c3576
 
PDF
Exporting Your In Design Portfolio
Sirron Carrector
 
PPTX
Preparing for Failure - Best Practise for Incident Response
Brian Honan
 
PPT
Finnish baseball
Tiina Sarisalmi
 
PPT
eTwinning Professional Development 2011
Tiina Sarisalmi
 
PPT
Sosiale medier
carstenhp
 
PPTX
Hazcrowd for Crowdsourcing
Tristan Cooke
 
Aubergine Parmigiana - Recipe
Tiina Sarisalmi
 
Prezentacja Gimnazjum Integracyjnego
zuza94
 
Sustainable and Responsible Investing
Scott Sadler
 
Long Life Bicycles
Silen disco
 
Google Wave og Wolfram Alpha
carstenhp
 
KMUTNB - Internet Programming 5/7
phuphax
 
Oriveden Keskuskoulu - Christmas Greeting from Preschool
Tiina Sarisalmi
 
Tactiek verdedigen
Johanda
 
Student Investment Fund
skyguy102
 
Denver Green Car Presentation
banovsky
 
eTwinning - lyhyt johdatus työpajatyöskentelyyn
Tiina Sarisalmi
 
One Source Solutions
scaster
 
Juliana New York
guest3c3576
 
Exporting Your In Design Portfolio
Sirron Carrector
 
Preparing for Failure - Best Practise for Incident Response
Brian Honan
 
Finnish baseball
Tiina Sarisalmi
 
eTwinning Professional Development 2011
Tiina Sarisalmi
 
Sosiale medier
carstenhp
 
Hazcrowd for Crowdsourcing
Tristan Cooke
 
Ad

Similar to KMUTNB - Internet Programming 4/7 (20)

PPT
Client Side Technologies
Anirban Majumdar
 
PPTX
Web technologies-course 07.pptx
Stefan Oprea
 
PPT
Javascript
mussawir20
 
PPT
JavaScript Workshop
Pamela Fox
 
PPTX
01_JavaScript_Advanced Level_Pratahb.pptx
prathabtwsi
 
PPS
Web Designing
VNIT-ACM Student Chapter
 
PDF
JS BASICS JAVA SCRIPT SCRIPTING
Arulkumar
 
PPTX
JavaScript with Syntax & Implementation
Soumen Santra
 
PDF
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
PPTX
Javascript note for engineering notes.pptx
engineeradda55
 
PDF
Jscript Fundamentals
rspaike
 
PPT
Java Script
siddaram
 
PPS
Advisor Jumpstart: JavaScript
dominion
 
PPTX
Before start
Medhat Dawoud
 
PPT
JAVA SCRIPT.pptbbdndndmdndndndndnndmmddnndn
harshithunnam715
 
DOCX
What is Web designing.docx? What are its components
ManjuGoyal4
 
PPT
Session vii(java scriptbasics)
Shrijan Tiwari
 
PPTX
Web Development.pptx sadfd fwd w dwdwdw
cxcxcsad
 
PDF
Basic JavaScript Tutorial
DHTMLExtreme
 
PPTX
Javascript
Mozxai
 
Client Side Technologies
Anirban Majumdar
 
Web technologies-course 07.pptx
Stefan Oprea
 
Javascript
mussawir20
 
JavaScript Workshop
Pamela Fox
 
01_JavaScript_Advanced Level_Pratahb.pptx
prathabtwsi
 
JS BASICS JAVA SCRIPT SCRIPTING
Arulkumar
 
JavaScript with Syntax & Implementation
Soumen Santra
 
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
Javascript note for engineering notes.pptx
engineeradda55
 
Jscript Fundamentals
rspaike
 
Java Script
siddaram
 
Advisor Jumpstart: JavaScript
dominion
 
Before start
Medhat Dawoud
 
JAVA SCRIPT.pptbbdndndmdndndndndnndmmddnndn
harshithunnam715
 
What is Web designing.docx? What are its components
ManjuGoyal4
 
Session vii(java scriptbasics)
Shrijan Tiwari
 
Web Development.pptx sadfd fwd w dwdwdw
cxcxcsad
 
Basic JavaScript Tutorial
DHTMLExtreme
 
Javascript
Mozxai
 
Ad

More from phuphax (8)

PDF
GPS Tracking by Tracking.in.th
phuphax
 
PPT
KMUTNB - Internet Programming 7/7
phuphax
 
PPT
KMUTNB - Internet Programming 6/7
phuphax
 
PPT
KMUTNB - Internet Programming 5/7
phuphax
 
PPT
KMUTNB - Internet Programming 3/7
phuphax
 
PPT
KMUTNB - Internet Programming 2/7
phuphax
 
PPT
KMUTNB - Internet Programming 1/7
phuphax
 
PPS
Abzolute Logistic Solution
phuphax
 
GPS Tracking by Tracking.in.th
phuphax
 
KMUTNB - Internet Programming 7/7
phuphax
 
KMUTNB - Internet Programming 6/7
phuphax
 
KMUTNB - Internet Programming 5/7
phuphax
 
KMUTNB - Internet Programming 3/7
phuphax
 
KMUTNB - Internet Programming 2/7
phuphax
 
KMUTNB - Internet Programming 1/7
phuphax
 
Abzolute Logistic Solution
phuphax
 

Recently uploaded (20)

PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPTX
Difference between write and update in odoo 18
Celine George
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PPTX
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Introduction presentation of the patentbutler tool
MIPLM
 
Controller Request and Response in Odoo18
Celine George
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
Horarios de distribución de agua en julio
pegazohn1978
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
Difference between write and update in odoo 18
Celine George
 
infertility, types,causes, impact, and management
Ritu480198
 
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 

KMUTNB - Internet Programming 4/7

  • 1. Cascade Style Sheet & Java Script & DOM By: Mr. PHUPHA PUNYAPOTASAKUL ( ภูผา ปัญญาโพธาสกุล )
  • 2. C ascading S tyle S heets CSS stands for C ascading S tyle S heets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem External Style Sheets can save a lot of work Multiple style definitions will cascade into one
  • 3. Cascading Order Browser default External style sheet Internal style sheet ( inside the <head> tag ) Inline style ( inside an HTML element )
  • 4. CSS Syntax Syntax selector {property : value} E.g. body {color : black} If value have space or special character p {font - family : &quot; sans serif &quot; }
  • 5. CSS Syntax Multiple properties (use semi-colon) p { text-align: center; color: black; font-family: arial } Grouping h1,h2,h3,h4,h5,h6 { color : green }
  • 6. CSS Syntax Class selector p.right {text-align: right} p.center {text-align: center} … <p class=&quot;right&quot;> ..</p> Applying more than one class <p class=&quot;center bold&quot;> .. </p> Class for any tag .right {text-align: right}
  • 7. CSS Syntax ID Selector #green {color : green} ID Selector for specific tag p#green {color : green} Applying style <p id=“green”> .. </p> Tag with specific attribute input [ type =&quot; text &quot;] {background - color : blue}
  • 8. CSS Comment Start with /* and end with */ Similar to C or JAVA E.g. /* This is a comment */ p { text-align: center; /* This is another comment */ color: black; font-family: arial }
  • 9. CSS Pseudo-classes Syntax selector:pseudo-class {property: value} selector.class:pseudo-class {property: value} E.g. a : link {color : #FF0000} /* unvisited link */ a : visited {color : #00FF00} /* visited link */ a : hover {color : #FF00FF} /* mouse over link */ a : active {color : #0000FF} /* selected link */ a . red : visited {color : #FF0000}
  • 13. Java Script JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language A JavaScript consists of lines of executable computer code A JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language ( means that scripts execute without preliminary compilation ) Everyone can use JavaScript without purchasing a license
  • 14. Java Script Basic Most of syntax same as JAVA Some JAVA feature was cut out e.g. public protected static etc. Case sensitive Interpreted language not compiled language Flexible data type
  • 15. Variables Syntax example var strname = &quot; Hege &quot; Variable scope Local: declared within a function Global: elsewhere Overriding global variable Implicit declaration
  • 16. Arithmetic Operators Decrement -- Increment ++ Modulus (division remainder) % Division / Multiplication * Subtraction - Addition + Description Operator
  • 17. Assignment Operators x=x%y x%=y %= x=x/y x/=y /= x=x*y x*=y *= x=x-y x-=y -= x=x+y x+=y += x=y x=y = Is The Same As Example Operator
  • 18. Comparison Operators is less than or equal to <= is greater than or equal to >= is less than < is greater than > is not equal != is equal to (checks for both value and type) === is equal to == Description Operator
  • 19. Flow control If then else Switch For loop While loop Break/continue statement
  • 20. Arrays Creating an array var mycars=new Array() ; var mycars=new Array(3) ; var mycars=new Array(&quot;Saab&quot;,&quot;Volvo&quot;,&quot;BMW&quot;) ; Accessing value in array alert( mycars[0] ); Dynamic length Flexible data type
  • 21. Basic Function alert(“some text”); confirm(“some text”); Return true/false prompt(“some text”,”default value”); Return user’s inputted value
  • 22. Java Script Object Contains information about the current URL Location Contains the visited URLs in the browser window History Contains information about the client's display screen Screen Contains information about the client's browser Navigator The top level object in the JavaScript hierarchy. The Window object represents a browser window. A Window object is created automatically with every instance of a <body> or <frameset> tag Window Description Object
  • 23. Events Examples of events : A mouse click A web page or an image loading Mousing over a hot spot on the web page Selecting an input box in an HTML form Submitting an HTML form A keystroke
  • 24. HTML Event onload and onUnload onFocus, onBlur and onChange onSubmit onMouseOver and onMouseOut And etc. Invoking Java Script function <input type =&quot; text &quot; size =&quot; 30 &quot; id =&quot; email &quot; onchange =&quot; checkEmail ()&quot; >
  • 25. HTML DOM The DOM (Document Object Model) presents an HTML document as a tree - structure ( a node tree ) , with elements, attributes, and text .
  • 27. Access Node Get element by ID document.getElementById('someID') Get element by tag name document.getElementsByTagName(&quot;p&quot;) Return value possible to be either object or array of object parentNode, firstChild, lastChild and etc.