florynth Posted June 27, 2006 Share Posted June 27, 2006 Hi,I'm doing a script that use the GetElementById function and I want to know with wich browser it's compatible.I do have a book (old one but...) who said for exemple to use document.all["id"] in IE 4.xBut anyway nobody use this anymore... So is there a current browser who's use that is not compatible with the function or I scratch my head for less then 1% of browser...Thanks for your answerMartin Link to comment Share on other sites More sharing options...
dbadlu Posted June 29, 2006 Share Posted June 29, 2006 getElementById is compatible with both IE and FireFox.document.all is compatible with only IE. Link to comment Share on other sites More sharing options...
scott100 Posted June 29, 2006 Share Posted June 29, 2006 Don't use document.all. document.getElementById() is supported by every Javascript supporting browser released since 1998.source: some website Link to comment Share on other sites More sharing options...
florynth Posted June 29, 2006 Author Share Posted June 29, 2006 Don't use document.all. document.getElementById() is supported by every Javascript supporting browser released since 1998.source: some website<{POST_SNAPBACK}> Thanks ! So another question :I want to change the content of the element the code I did have before isif(document.getElementById) { element = document.getElementById(Id); element.innerHTML = content; } else if(document.layers) { element = document.layers[Id];element.document.open(); element.document.write(content); element.document.close(); } The second part was for Netscape. Since everything support getElementById do everything support also the innerHTML or I will have the do a browser detection instead?Just to let you know I'm creating a object in javascript to manage div that's not exactly the code I'll use but I don't need to show everything to have my answer... I'll post a message with the code when it will be ready to work and have some usefull function... Link to comment Share on other sites More sharing options...
aspnetguy Posted June 29, 2006 Share Posted June 29, 2006 I am pretty sure they all support innerHTML aswell. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now