📜  使用模板文字创建 html - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:05.538000             🧑  作者: Mango

代码示例2
// Create our object
const person = {
    name: 'TopCoder2021',
    job: 'Software Developer,
    city: 'Los Angeles',
    bio: 'Tony is a really cool guy that loves to code!'
}

// And then create our markup:
const markup = `
 

${person.name}

${person.city}

${person.bio}

`; document.body.innerHTML = markup