Answers for "js match img"

0

js match img

var html = '<img src="http://static2.ccn.com/ccs/2013/02/CC_1935770_challenge_accepted_pack_x3_indivisible.jpg" />';

var re = /<img[^>]+src="http:\/\/([^">]+)/g
var results = re.exec(html);

var source = results[1];
alert(source);
Posted by: Guest on December-06-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language