File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,27 @@ <h1>Basic jQuery</h1>\
23
23
</div>\
24
24
</div>\
25
25
</body>" ,
26
- ) ;
26
+ ) ; /*
27
27
$("#2").css({ color: "red" });
28
28
$("#3").click(function () {
29
29
$("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
+ } ) ;
30
47
} ) ;
31
48
} ) ;
32
49
</ script >
You can’t perform that action at this time.
0 commit comments