JavaScript:
var data='<div id="hai">this is div</div>';
I am looking to retrieve only the ID "hai" using a regular expression in JavaScript. The expected output should be,
var id = regularexpression(data);
The variable id should now contain "hai". Can anyone assist me in writing a regular expression for this in JavaScript?