Display only HTML links 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 );
精彩评论