getElementById() method for document
I have been working on an Ajax page for the past two days and have no effect of refreshing and updating data. After IE was successfully debugged, I tested the effect under Firefox, but found that there was no reaction... After
checking for a long time, I found that Firefox could not be directly referenced through ID. The solution is to use the document's getElementById() method to return it.
Original code:
document.all.new_news.innerHTML=" output results"
Modified code:
document.getElementById ('new_news').innerHTML=" output result"
This way, IE and Firefox can be used normally, especially as Tips.
Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: https://www.shududu.com/life/getElementById-method-for-document.htm