Beruflich Dokumente
Kultur Dokumente
“DOM”
<!DOCTYPE html>
<html>
<head>
<title>jQuery Adventures</title> browser
</head>
<body>
<h1>Where do you want to go?</h1> 0% 50% 100%
DOM
<p>Plan your next adventure.</p>
</body>
</html>
DOCUMENT
html
head
title
JavaScript
jQuery Adven...
body JavaScript gives developers a
h1 language to interact with the DOM.
Where do...
p
Plan your...
JavaScript JavaScript
DOM
DOM
JavaScript DOM
DOM
DOM
DOM
JavaScript DOM
If our JavaScript uses jQuery to interact
with the DOM then it will work on most DOM
modern browsers.
jQuery(<code>);
JavaScript
jQuery(document);
JavaScript
<!DOCTYPE html>
<html>
<head>
<title>jQuery Adventures</title>
</head>
<body>
jQuery("h1");
jQuery("p");
= $("h1");
$("p");
short & sweet
<h1>Where do you want to go?</h1> syntax
<p>Plan your next adventure.</p>
</body>
</html>
DOCUMENT
html
$("h1") ; head
title
jQuery Adv...
body
h1
Where do...
p
Plan your...
html
$("h1").text(); head
title
"Where do you want to go"
jQuery Adv...
body
h1
Where do...
p
Plan your...
html
“I’m ready!”
jQuery(document).ready(function(){
DOM
<code>
});
“I’m ready!”
Will only run this code once the DOM is “ready”
jQuery(document).ready(function(){
$("h1").text("Where to?");
});