MCQs > IT & Programming > JavaScript > What's the output? document.getElementById('banana').className = document.getElementById('banana').className.replace( /(?:^|\s)apple(?!\S)/g ,'e' );

JavaScript MCQs

What will be the result of the following code? document.getElementById("banana").className = document.getElementById("banana").className.replace( /(?:^|\s)apple(?!\S)/g ,'e' );

Answer

Correct Answer: Replace class ‘apple’ with ‘e’ in the HTML element which contains ID ‘banana’

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it