Single Choice Easy

QWhat would the following JavaScript code produce?

<p id="demo"></p>
<script>
var x = 'It\'s';
document.getElementById("demo").innerHTML = x ; 
</script>

ID: #5132 Javascript DOM & Event Handling MCQ 121 views
Question Info
#5132Q ID
EasyDifficulty
Javascript DOM & Event Handling MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A It\
  • C It
  • D Error
Correct Answer

Explanation

A backslash is placed in front of any apostrophes found in the string.
After a backslash, the string skips over the character's execution.

Share This Question

Challenge a friend or share with your study group.