Interacting with HTML
Download these now, we'll make sure everyone is ready to start!
Download the files and extract them
Open the entire folder in your text editor
You'll revisit these!
like peanut butter and chocolate
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>All About Bears</title>
<style type="text/css">
h1 {
color: blue;
}
#mainpicture {
border: 1px solid black;
}
.bearname {
font-weight: bold;
}
</style>
</head>
<body>
<h1>BEARS!</h1>
<img id="mainpicture" src="http://placebear.com/200/300">
<p>The No. 1 Threat To America</p>
<ul>
<li class="bearname">Smokey</li>
<li class="bearname">Teddy</li>
</ul>
</body>
</html>
<h1>BEARS!</h1>
<img id="mainpicture" src="http://placebear.com/200/300">
<p>The No. 1 Threat To America</p>
<ul>
<li class="bearname">Smokey</li>
<li class="bearname">Teddy</li>
</ul>
+ javascript
<script>
document.body.innerHTML += "Bears are great!"
</script>
This is how we put JavaScript on the page
Open your index.html page
Add a <script> tag
Use
to append your name to the page
document.body.innerHTML += "Your Name"
$('body').append("I don't think you realize how awesome bears are");
$('body').append("<br>they're <em>really</em> awesome.");
<h1>BEARS!</h1>
<img id="mainpicture" src="http://placebear.com/200/300">
<p>The No. 1 Threat To America</p>
<button id="newbear">New Bear</button>
<ul>
<li class="bearname">Smokey</li>
<li class="bearname">Teddy</li>
</ul>
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script>
$('body').append("jQuery Works!");
</script>
A Link to jQuery
Your Code
Time for a CFU!
Add jQuery to your page
Complete the first few steps of the exercise repository!
We're going to make a dynamic list!
Practice Practice Practice!
Take a longer class:
Learn ALL the Javascript: