File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ <h3>Don't Laugh Challenge</h3>
16
16
< br > < br > < br >
17
17
< div id ="container2 " class ="container ">
18
18
< h3 > Don't Laugh Challenge: Computer Science Edition</ h3 >
19
- < div id ="csJoke " class ="joke "> // Joke goes here </ div >
20
- < button class ="btn " onclick ="generateCSJoke(); "> Get Another Joke</ button >
19
+ < div id ="csJoke " class ="joke "> Click the button for a Computer Science joke! </ div >
20
+ < button id =" csJokeBtn " class ="btn " onclick ="generateCSJoke(); "> Get Another Joke</ button >
21
21
</ div >
22
22
< script language ="JavaScript ">
23
23
var jokes = [ "What did the hungry computer scientist do? Get a byte to eat!" ,
@@ -34,7 +34,8 @@ <h3>Don't Laugh Challenge: Computer Science Edition</h3>
34
34
jokeDiv . setAttribute ( "class" , "joke" ) ;
35
35
const jokeContent = document . createTextNode ( jokes [ i ] ) ;
36
36
jokeDiv . appendChild ( jokeContent ) ;
37
- document . getElementById ( 'container2' ) . appendChild ( jokeDiv ) ;
37
+ var csJokeButton = document . getElementById ( "csJokeBtn" ) ;
38
+ document . getElementById ( 'container2' ) . insertBefore ( jokeDiv , csJokeButton ) ;
38
39
}
39
40
</ script >
40
41
</ body >
You can’t perform that action at this time.
0 commit comments