為什么沒有顯示出P標簽的字段?
<script?type="text/javascript">document.getElementById("p1")=document.write("JS進階篇");????function?gg(){????????????????var?message?=?confirm("是否要彈窗");????????if(message?==?true){????????????alert("關(guān)注JS高級篇");????????????????????}????}</script></head><body>????<p?id="p1"></p>????<button?type="button"?onclick="gg()">點我彈窗顯示</button>
這段代碼這么寫為什么不顯示“JS進階篇”??
2019-03-01
document.getElementById(
"p1"
)=document.write(
"JS進階篇"
);?
他會報錯分配的左側(cè)無效2019-03-01
沒事,我還是小白,多指教