84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
<img src="/wp-content/cache/gravatar/0950d573f5c720dced074953c96b8510.png" alt="">
上述的HTML代码是存在于JS文件中的字符串,现在如何使用JS取出其中的 /wp-content/cache/gravatar/0950d573f5c720dced074953c96b8510.png?
/wp-content/cache/gravatar/0950d573f5c720dced074953c96b8510.png
认证高级PHP讲师
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
给个id,通过js获取元素,元素.src就是你要的了。
http://www.cnblogs.com/mingji...
给个id,通过js获取元素,元素.src就是你要的了。
http://www.cnblogs.com/mingji...