Question: Write JAVASCRIPT for toggleCommentButton a. Receives a postId as the parameter b. Selects the button with the data-post-id attribute equal to the postId received as
Write JAVASCRIPT for
toggleCommentButton
a. Receives a postId as the parameter
b. Selects the button with the data-post-id attribute equal to the postId received as a
parameter
c. If the button textContent is 'Show Comments' switch textContent to 'Hide
Comments'
d. If the button textContent is 'Hide Comments' switch textContent to 'Show
Comments'
e. Suggestion (not required) for above: try a ternary statement
f. Return the button element*/
function toggleCommentButton(PostId) {
}
Step by Step Solution
3.43 Rating (156 Votes )
There are 3 Steps involved in it
The JavaScript code for the toogleCommentButton function based on your r... View full answer
Get step-by-step solutions from verified subject matter experts
