Using document.querySelector on non standard selectors

6 views
Skip to first unread message

djber...@gmail.com

unread,
Dec 7, 2017, 8:00:47 AM12/7/17
to phantomjs
Hi,

Does anyone know a way to select elements with non standard selectors for example.

<input type="number" data-parsley-id="xxxx">

document.querySelector('input[data-parsley-id="xxxx"]') doesn't appear to work.

<input type="number" id="xxxx">

document.querySelector('input[id="xxxx"]') works.


Thanks
Duncan
Reply all
Reply to author
Forward
0 new messages