document.write clear all controls of page
document.write clear all controls of page HI' when the document.write be run, all controls in the web开发者_高级运维 pages will be clear . why? In asp file
Use innerHTML of say a div to write.
<div id="iwanttowritemore"></div>
Then in JS:
document.getElementById("iwanttowritemore").innerHTML = "i can write without clearing the page"
You can't use document.write
after the page has loaded, it'll replace the entire page with the contents of said function. Use something else like innerHTML
if you need to insert content after the page loads. document.write
is kinda frowned upon anyways.
精彩评论