<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>模版字符串</title>
</head>
<body>
<div class="div1"></div>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
<script type="text/javascript">
//我们学习了ES6的模版字符串,现有传统的字符串拼接方式,我们使用S6中提供了模版字符串来实现下。
//任务提示
//第一步:用`(反引号)标识
//第二步:用${}将变量括起来
let person ={
name:"xiaoming",
age:18
}
$(".div1").append(
`He is <b>${ person.name }</b>\
and we wish to know his${ person.age }.That is all<br>`
);
// 补充代码
</script>
</body>
</html>