Write JAVASCRIPT for toggleCommentButton a. Receives a postId as the parameter b. Selects the button with the
Fantastic news! We've Found the answer you've been seeking!
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 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) {
}
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: