4
下面的代碼打印是否有可能獲得createTextNode方法來呈現html標記?
這應該打印(b)本應打印(/ B)這應該打印
<script>
function produceMessage(){
var msg= '<b>This should print</b>';
return msg;
}
</script>
<span id="mySpan"></span>
<script>
document.body.appendChild(document.createTextNode(produceMessage()));
document.write(produceMessage());
document.getElementById('mySpan').innerHTML=produceMessage();
</script>
在內聯元素中使用encase javascript會不好實踐嗎? – user784637