Ticket #6918 (closed bug: worksforme)
Attaching data() to two different elements with identical markup
|Reported by:||jonraasch||Owned by:|
|Keywords:||data identical markup||Cc:|
When attaching data() to two different elements with identical markup, I experienced a bug where the second element's data() object was being retrieved from both the first and second element. I think it is overwriting it due to the identical markup / classnames.
Here is an example of the markup associated with the error:
<a title="Goldstone 12mm faceted briolette" class="gkc-bead gkc-stone-gold12bsf" href="#"><span class="centerOuter"><span class="centerMiddle"><img class="centerInner" alt="Goldstone 12mm faceted briolette" src="/images/gke-beads/gold12bsf_1.png"></span></span>Goldstone</a>
Note that both elements with this markup also had identical styling.
I have checked and can confirm that I am applying a unique data() object to each of the two elements, and retrieving them separately, however both return the second element's data.