<div id="content"></div> <script type="text/javascript"> var content=document.getElementById("content"); // var str = "_<script defer>alert('hi');<\/script>"; var str="<input type=\"hidden\"><script defer>alert('hi');<\/script>"; content.innerHTML=str; </script>
2 回答
qq_sU_4
TA贡献30条经验 获得超6个赞
var str="alert('hi');"; var scriptNode=document.createElement('script'); scriptNode.innerHTML=str; content.appendChild(scriptNode);
添加回答
举报
0/150
提交
取消