如何使模板已经在HTML中使用了重新出现
所以我试图在它从屏幕上消失后用按钮重置它。我尝试了 document.write() 但它不起作用,所以我在使用后尝试在 HTML 中重写我的模板,这样我就可以再次将它与其他数据一起使用。这可能吗? 这是我的 HTML:
<template id="playlist__screen">
<button class="backbutton" onclick="onClick()"></button>
<p class="playlist__type">{{style}}</p>
<h2 class='playlist__titre'>{{titre}}</h2>
<p class="playlist__desc">{{description}}</p>
</template>
So I'm trying to reset it after it disappears from the screen with a button. I tried a document.write() but it doesn't work, So I try that after being used, to rewrite my template argue in my HTML so I can use it again with other datas. Is that even possible?
This is my HTML:
<template id="playlist__screen">
<button class="backbutton" onclick="onClick()"></button>
<p class="playlist__type">{{style}}</p>
<h2 class='playlist__titre'>{{titre}}</h2>
<p class="playlist__desc">{{description}}</p>
</template>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是如何使用模板
Here is how you use a template