It’s very simple, you create a new DOM node <p id="content"></p>, then var a variable equal to this code, assign this variable to the DOM node, use jQuery method As mentioned above, the native method is <script>
var str = "那段代码";
document.getElementById("content").innerHTML(str);
You can use jQuery to replace tags
You try it! Dude, don’t forget to introduce jQuery
Of course, native js is also possible
It’s very simple, you create a new DOM node <p id="content"></p>, then var a variable equal to this code, assign this variable to the DOM node, use jQuery method As mentioned above, the native method is
<script>
</script>
// [3]. Use templates to generate HTML. The output is escaped by default. If not escaped, use {{#value}}
I happened to encounter this problem when I was using artTemplate recently.
Use
{{@html}}
for original text outputThere are risks, use with caution.
Official tutorial: https://aui.github.io/art-tem...Original text output