I have an regex to find the part of a <a href="">
within the innerHTML of a div.
var b = this.innerHTML.match(/href="([^\'\"]+)/g);
var c = b[0].split('#')[1];
window.location.assign('#'+c);
and would like to get rid of the second line, the .split function. Is there a way to do this? Ideally, I'd like to keep the hashtag before the div, too:
The hrefs are allways like this (only the number is subject to change):
href="#div46"
href="#div47"
...