IDs should not be duplicated. Ideally, should use class names:
<div class="homeAddress">
<div class="addrsModuleFromSomeone">.....</div>
</div>
<div class="officeAddress">
<div class="addrsModuleFromSomeone">.....</div>
</div>
The use (note the period instead of pound symbol):
$$('.addrsModuleFromSomeone').length
// Result should be '2'
Using the same IDs leads to unpredictable behavior by the web
browser. ID implies a unique identifier, whereas class describes the
tag, which makes more sense in this case.
- Jeff
On Mar 2, 2010, at 1:00 AM, Hari wrote:
Hi,
I have two element ID's same as below unfortunately....
<div id="homeAddress">
<div id="addrsModuleFromSomeone">.....</div>
</div>
<div id="officeAddress">
<div id="addrsModuleFromSomeone">.....</div>
</div>
When I do $$('#addrsModuleFromSomeone').length in firefox I get 2 but
I get only one in IE...
And also only in IE (ff it works fine)...
$$('#homeAddress #addrsModuleFromSomeone') gives me the aoddress
element....
$$('#officeAddress #addrsModuleFromSomeone') gives me null....
I cannot change the id of the addrsModule id since someone else had
written it.
Can some help me with this?
Regards,
Hari
--
You received this message because you are subscribed to the Google
Groups "Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
.
To unsubscribe from this group, send email to [email protected]
.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en
.
--
You received this message because you are subscribed to the Google Groups "Prototype
& script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.