搜索文档
首页
HTML/CSS
JavaScript
服务端开发
Java教程
移动端
数据库
当前位置:
首页
JavaScript
JavaScript 教程
JavaScript基础教程
源代码
清空
点击运行
<!DOCTYPE html> <html> <title>JavaScript 反引号字符串示例 - 基础教程(div.cn)</title> <body> <p>使用模板常量,反引号来消除对长字符串的串联或转义的需要:</p> <p id="para"></p> <script> var str = `Air Pollution is introduction of chemicals to the atmosphere. It damages environmental balance and causes several diseases.`; document.getElementById("para").innerHTML = str; </script> </body> </html>
运行结果