Skip to content

Commit 99f77f9

Browse files
committed
Commented-out video's events; added 2 of my own events
1 parent 5cb42d3 commit 99f77f9

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

jQuery/jQuery.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,27 @@ <h1>Basic jQuery</h1>\
2323
</div>\
2424
</div>\
2525
</body>",
26-
);
26+
); /*
2727
$("#2").css({ color: "red" });
2828
$("#3").click(function () {
2929
$("h1").hide();
30+
});*/
31+
32+
$(document).ready(function () {
33+
// HAD to add the "$(document).ready()" part for this to work; "function()" desnn't run as a standalone ()
34+
$("#1").click(function () {
35+
// "When the element with id==1 is clicked, do what's in the curly brackets"
36+
$("#2").append(
37+
// "Append the text below to the element with id==2, once the above happens"
38+
" - This was APPENDED here <em>after</em> you clicked the sentence above!<hr>(Click below to hide these lines...)",
39+
);
40+
});
41+
});
42+
$("document").ready(function () {
43+
// What I learned from the above comment made creating this () much easier...
44+
$("#3").click(function () {
45+
$("#2").hide("slow"); // Same as above (); when element with id==3 is clicked, SLOWLY hide the element with id==2
46+
});
3047
});
3148
});
3249
</script>

0 commit comments

Comments
 (0)