Jump to content

pouria.zareie@gmail.com

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About pouria.zareie@gmail.com

  • Rank
    Newbie
  1. <!-- error in code var x = "0"; --> <!DOCTYPE html> <html> <body> <h2>JavaScript switch</h2> <p id="demo"></p> <script> var x = "0"; switch (x) { case 0: text = "Off"; break; case 1: text = "On"; break; default: text = "No value found"; } document.getElementById("demo").innerHTML = text; </script> </body> </html> <!-- this is true code var x = 0; --> <!DOCTYPE html> <html> <body> <h2>JavaScript switch</h2> <p id="demo"></p> <script> var x =0; switch (x) { case 0: text = "Off"; break; case 1: text = "On"; break; default: text = "No value found"; } document.getElementById("demo").innerHTML = text; </script> </body> </html>
×
×
  • Create New...