Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <div id="SearchList">
  2. <a href="www.google.com/up">up</a>
  3. <a href="www.google.com/down">down</a>
  4. <a href="www.google.com/left">left</a>
  5. <a href="www.google.com/right">right</a>
  6. </div>
  7.  
  8. <div id="SearchList">
  9. <a href="www.bing.com/up">up</a>
  10. <a href="www.bing.com/down">down</a>
  11. <a href="www.bing.com/left">left</a>
  12. <a href="www.bing.com/right">right</a>
  13. </div>
  14.  
  15. // For each anchor element...
  16. $("#SearchList a").each(function() {
  17.  
  18. // Change its 'href' attribute to...
  19. $(this).attr("href",
  20.  
  21. // Its current 'href' attribute with a .replace() called
  22. $(this).attr("href").replace("google", "bing"));
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement