Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <img src ="planets.gif" width="145" height="126" alt="Planets" usemap ="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126" href="sun.html" alt="Sun"> <area shape="circle" coords="90,58,3" href="mercur.html" alt="Mercury"> <area shape="circle" coords="124,58,8" href="venus.html" alt="Venus"> </map> <p> <a href="../html/default.html">HTML</a><br> <a href="../css/default.html">CSS</a> </p> <p>Click the button to display the URL of each link in the document.</p> <button type="button" onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.links; var txt = ""; var i; for (i = 0; i < x.length; i++) { txt = txt + x[i].href + "<br>"; } document.getElementById("demo").innerHTML = txt; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_doc_links2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:11:00 GMT --> </html>
Result:
Try it Yourself - © w3schools.com