<img src="/wp-content/cache/gravatar/0950d573f5c720dced074953c96b8510.png" alt="">
上述的HTML代码是存在于JS文件中的字符串,现在如何使用JS取出其中的 /wp-content/cache/gravatar/0950d573f5c720dced074953c96b8510.png
?
怪我咯2017-04-11 13:30:39
let str=`<img src="/wp-content/cache/gravatar/0950d573f5c720dced074953c96b8510.png" alt="">`;
let url=$(str).attr('src');
console.log(url);
///wp-content/cache/gravatar/0950d573f5c720dced074953c96b8510.png