Answers for "javascript match image attribute value"

0

javascript match image attribute value

var str = "<img alt='' src='http://api.com/images/UID' /><br/>Some plain text<br/><a href='http://www.google.com'>http://www.google.com</a>";

var regex = /<img.*?src='(.*?)'/;
var src = regex.exec(str)[1];

console.log(src);
Posted by: Guest on December-31-2020

Code answers related to "javascript match image attribute value"

Code answers related to "Javascript"

Browse Popular Code Answers by Language