intro to jquery
intro to jquery
intro to jquery
intro to jquery
intro to jquery
intro to jquery
set up a web project with css, js and and the index.html file
intro to jquery
<div class="container">
<h1>HTML help</h1>
<p>
This is a very special page. If you click somewhere, it will
tell you what type of html element you clicked on
</p>
<p>
Look at this cute warlus!
</p>
<img src="images/warlus.jpg" alt="" />
</div>
intro to jquery
jQuery("h1").click(function() {
alert("This is a header!");
});
jQuery("p").click(function() {
alert("This is a paragraph!");
});
jQuery("img").click(function() {
alert("This is an image!");
});
intro to jquery
jQuery(document).ready(function(){
jQuery("h1").click(function() {
alert("This is a header!");
});
jQuery("p").click(function() {
alert("This is a paragraph!");
});
jQuery("img").click(function() {
alert("This is an image!");
});
});
intro to jquery
$(document).ready(function(){
$("h1").click(function() {
alert("This is a header!");
});
$("p").click(function() {
alert("This is a paragraph!");
});
$("img").click(function() {
alert("This is an image!");
});
});
intro to jquery
<div>
<h1>Peek-a-Boo</h1>
<p>
Let's play peek-a-boo. Click here to see the surprise!
</p>
<img src="images/warlus.jpg" alt="" />
</div>
intro to jquery
img{
display: none;
}
intro to jquery
make the image reappear on click
intro to jquery
$('{selector}').css('{property}', '{value}');
intro to jquery
$('{selector}').css('{property}', '{value}');