开发者

Display only HTML links jQuery

开发者 https://www.devze.com 2022-12-21 12:04 出处:网络
I have 开发者_如何学编程a url and I want to display only the html links or URLs using jQuery.

I have 开发者_如何学编程a url and I want to display only the html links or URLs using jQuery.

Thanks Jean


Taking a wild, wild stab in the dark here, hopefully hitting something that comes close to what you're really asking. This selector will get all links on the page that end with '.html':

$('a[href$=.html]').each(function () {
    alert(this);
    // do whatever you want to do with 'this'
}

http://api.jquery.com/category/selectors/attribute-selectors/


do the pattern match for url , whether the url is ending .html extenstion .

preg_match ( '/.html$/',$url ,$val );

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号