Jump to content

RecoJohnson

Members
  • Posts

    1
  • Joined

  • Last visited

RecoJohnson's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Can someone guide me in the right direction?I am trying to verify links and if they are real links they turn green, else they turn red. <html><head><title>TRYING TO LEARN - NOT WORKING - FUUUUU</title><script type="text/javascript">function isUrl(s) {var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/return regexp.test(s); for(var i=0;i<document.getElementByTagName("a").length;i++){if (isUrl(document.getElementByTagName("a").href)){document.getElementByTagName("a").setAttribute("color","green");}else{document.getElementByTagName("a").setAttribute("color","red");} }</script></head><body><a href="http://www.google.ca">GOOGLE</a><a href="http://www.9as0danotwaebsite.ca">GOOGLE</a></body></html>
×
×
  • Create New...