是否可以使用jQuery选择href以"ABC"结尾的所有链接?
$('a[href$="ABC"]')...
选择器文档可以在http://docs.jquery.com/Selectors找到
对于属性:
= is exactly equal != is not equal ^= is starts with $= is ends with *= is contains ~= is contains word |= is starts with prefix (i.e., |= "prefix" matches "prefix-...")
$('a[href$="ABC"]:first').attr('title');
这将返回第一个链接的标题,该链接具有以"ABC"结尾的URL.
$("a[href*='id=ABC']").addClass('active_jquery_menu');
$("a[href*=ABC]").addClass('selected');