Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.0.0.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <ul>
    <li>
      <a href="/" >example</a>
    </li>
    <li>
      <a href="/601" >601</a>
    </li>
  </ul>
</body>
</html>
 
var urls = [];
$("a").each(function() { 
    urls.push(this.href);
});
console.log('All Urls:', urls);
var filtered = [];
$("a").each(function() {
    var url = this.href;
    if (url.includes("601")) {
        filtered.push(url);
    }
});
console.log('Filtered Urls:', filtered);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers