Hey guys. This one's a bit tricky.
I have this big string of html. And I need a way to replace the first occurrence of anything in between [src="] and ["] or [src='] and ['] in javascript.
Replace src attribute in a string.
Moderator: General Moderators
It's not DOM elements. Like I said it's a string, stored in an attribute to an element.feyd wrote:That would probably be regex if it's not DOM elements.
I would think it would be regex. But how would I accomplish this? I could use the .replace() method. But I don't know how I could select anything and everything that's wrapped around qoutes and "src=". Could someone give me a hint on this one. I'm not that great at regex.