07-14-2002, 04:59 AM
When i use JavaScripts in my HTML code, i reference many thing sso that i may creat innotive and cool scripts. However, one things concerns me.

When i reference a'DHTML Element' eg <span><div> etc, i do this:

document.all["span / div id selector"].property

However, apparently, you can also do this

span/ div id

I know this is correct, but, as there are compatibilit issues, is one more compatible than the other?
or should i make a simple browser script at the start to justify which one to use?

Any help appreciated :)

Derek Stone
07-14-2002, 02:40 PM
Use the former.


07-16-2002, 04:06 PM
I typically stick with the first method you posted (which is for IE). Since IE and Netscape do this differently, I use browser a detection script. Something like:

ns = (document.layers)?
true:false //check for netscape
ie = (document.all)? true:false //check for internet explorer

function SetProp()

if (ns)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum