I have a XSL that created multiple elements with the id of “createdOn” plus a $unique-id
Example : createdOnid0xfff5db30
I want to find and store these in a variable using JavaScript. I’ve tried
var dates = document.getElementsById(/createdOn/);
but that doesn’t appear to work.
Using jQuery you can use the attr starts with selector:
Using modern browsers, you can use the CSS3 attribute value begins with selector along with
querySelectorAll:But for a fallback for old browsers (and without jQuery) you’ll need: