Home >Web Front-end >JS Tutorial >Try making the type attribute of script equal to text/html_javascript trick
We can define a code called by JS in the <script> fragment, but the code is not displayed on the page. In this case, we can use the following method: <BR><div class="codetitle"><span><a style="CURSOR: pointer" data="89495" class="copybut" id="copybut89495" onclick="doCopy('code89495')"><U> Copy the code The code is as follows: <div class="codebody" id="code89495"> <BR><script id="commentTemplate" type="text/html"> <BR><li> <BR> <div class="photo"> <BR><a href="#"> <BR><img src="/static/imghwm/default1.png" data-src="[UserImg]" class="lazy" / alt="Try making the type attribute of script equal to text/html_javascript trick" > <BR><p> <BR><a href="#">[UserName]:<span class="time">[CreateDate]</script>
> ;