I have a XSL that created multiple elements with the id of \"createdOn\" plus a $unique-id
Example : createdOnid0xfff5db30
I want to find a
You should have just used simple CSS selector together with JavaScript's .querySelectorAll() method.
CSS
JavaScript
In your case :
var dates = document.querySelectorAll('[id^="createdOnId"]');