W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h2>JavaScript 字符串</h2> <p>您可以在字符串中使用引号,只要不匹配围绕字符串的引号即可:</p> <p id="demo"></p> <script> var answer1 = "It's good to see you again!"; var answer2 = "He is called 'Bill'"; var answer3 = 'He is called "Bill"'; document.getElementById("demo").innerHTML = answer1 + "<br>" + answer2 + "<br>" + answer3; </script> </body> </html>