0
Good morning! I have this script that lists all the links of a page, but it does not bring the name of the link but only the address, it has to bring the name of the link instead of the address?
javascript: var a = document.getElementsByTagName('a');var b = a.length; if(b != 0){ document.write('<h1> Lista de Links </h1> '); for (i = 0; i < b; i++){ document.write('<pre><a href=\'' + a[i] + '\'>' + a[i] + '</a>' + '</pre> ');}} else{ document.write('Nenhum link encontrado');}
testing the answers
– Miguel Silva