Question: Workspace 5 // Add your event handlers 6 - onEvent ( upButton, click, function( ) { 7 Likes = Likes + 1; 8 setText (
Workspace 5 // Add your event handlers 6 - onEvent ( "upButton", "click", function( ) { 7 Likes = Likes + 1; 8 setText ( "likeCounterOutput", "Likes: " + Likes); 9 10 // Adds +1 likes to the total like counter 11 12 - onEvent ("downButton", "click", function() { 13 Likes = Likes - 1; 14 setText ( "likeCounterOutput", "Likes: " + Likes); 15 }); 16 // Adds -1 likes to the total like counter 17 18 - onEvent ("commentButton", "click", function() { 19 var newComment = getText ("newCommentInput" ) ; 20 Comments = (Comments+ "\\") + newComment; 21 setText ("allCommentsOutput", Comments) ; 22 23 // Add new line of comment to the all comments box
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
