ShuDudu's Home was started in 2011, but the web data is lost, so now begin again, I would like to make some friends, I hope you like ShuDudu's home.
Current position: ShuDudu > Life >

getElementById() method for document

Thursday on January 1st, 1970Life

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