02 模板字符串
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div class="box">
</div>
<script>
//获取当前.box标签对象
const oBox = document.querySelector('.box')
let id = 1,name = 'walter';
// oBox.innerHTML = '<ul><li><p id="+id+">'+name+'</p></li></ul>'
//另一种模块字符串实现 变量转换字符串
oBox.innerHTML = `<ul><li><p id=${id}>${name}</p></li></ul>`
</script>
</body>
</html>