Javascript 选择href属性不以字符串开头的元素

Javascript 选择href属性不以字符串开头的元素,javascript,jquery,Javascript,Jquery,$('.el[href^=“view.php”]').css('background','gold') 您可以在jQuery中使用选择器: $('.el').not('[href^=“view.php”]').css('background','gold')

$('.el[href^=“view.php”]').css('background','gold')

您可以在jQuery中使用选择器:

$('.el').not('[href^=“view.php”]').css('background','gold')