Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
change
HTML content
listen
animate
talk
Changing content
HTML document
<!DOCTYPE html>
<html>
<head>
<title>jQuery Adventures</title>
</head>
<body>
<h1>Where do you want to go?</h1>
<p>Plan your next adventure.</p>
</body>
</html>
find it
DOM
1.1 What is jQuery?
browser
0%
50%
100%
DOM
The DOM
DOCUMENT
html
head
title
jQuery Adven...
body
h1
Where do...
p
Plan your...
node types:
element
text
body
h1
Where do...
p
Plan your...
node types:
JavaScript
element
text
Web Browser
Requests a Webpage
Loads into
Sends the HTML
HTML
JavaScript
HTML
s
t
c
a
r
e
t
In
JavaScript
th
i
w
DOM
DOM
DOM
DOM
DOM
jQuery(<code>);
JavaScript
jQuery(document);
JavaScript
CSS selectors
h1 { font-size: 3em; }
p { color: blue; }
jQuery selectors
jQuery("h1");
jQuery("p");
$("h1");
$("p");
short & sweet
syntax
HTML document
<!DOCTYPE html>
<html>
<head>
<title>jQuery Adventures</title>
</head>
<body>
<h1>Where do you want to go?</h1>
<p>Plan your next adventure.</p>
</body>
</html>
DOCUMENT
html
head
title
jQuery Adv...
body
h1
Where do...
p
Plan your...
$("h1") ;
head
title
jQuery Adv...
body
h1
Where do...
p
Plan your...
$("h1").text();
"Where do you want to go"
head
title
jQuery Adv...
body
h1
Where do...
p
Plan your...
head
title
jQuery Adv...
body
h1
Where to?
p
Plan your...
HTML
0%
50%
100%
DOM
HTML
0%
50%
100%
DOM
Im ready!
DOM
Im ready!