Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

console.log()方法输出问题

var oDiv=document.querySelector('div');
        var oP=document.createElement('p');
        console.log(oP);
        oP.innerHTML='hello';
        oDiv.append(oP);

这里为什么输出不是<p></p>,而是<p>hello</p>呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

这是把你的节点输出,节点中不是包括内容的嘛


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...