App下載
首頁javascriptattributejQuery Selector - 如何通過href鏈接選擇anchor,不包括某些協(xié)議

jQuery Selector - 如何通過href鏈接選擇anchor,不包括某些協(xié)議

我們想知道如何通過href鏈接選擇anchor,不包括某些協(xié)議。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.5.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    console.log($('a:not([href^="callto"])').length);
});
</script>
</head>
<body>
  <a >Google</a>
  <a href="callto://01234123123">Skype Link</a>
</body>
</html>