I'm creating custom validation function used in Magento and there are passed 2 parameters to callback: v - value of field, element - element that is validated. My problem is that this HTML element is string and I can't use Prototype to create JavaScript object like when I use jQuery:
var element = '<input type="text" value="ABC" name="some_name" class="class1 class2" />';
console.log(jQuery(element));
How to get the same result with Prototype?
If you have a string that is HTML and want a HTMLElement object from it this will work
This is also helpful if you need to select specific elements out of a long string of HTML