querySelectorAll is not finding dynamically added elements with custom attribute
Posted
by
Exception
on Stack Overflow
See other posts from Stack Overflow
or by Exception
Published on 2013-06-28T09:25:51Z
Indexed on
2013/06/28
10:21 UTC
Read the original article
Hit count: 172
JavaScript
I am creating two way binding between JS Object and UI in below fiddle, code is big to post Please check http://jsfiddle.net/bpH6Z/20/
I am using the code like below
var elements = document.querySelectorAll("[" + data_attr + "] *[bd='" + prop_name + "']");
I have mentioned the problem line in big comments, can be identified easily. My problem is I am adding elements to binded dynamicaly using JS, when I change the value in UI, the same value is not reflected in other places. The problem is querySelectorAll is faling to find elements with same attribute. It is finding only first occurrence. Please look into the issue.
© Stack Overflow or respective owner