var collection = document.getElementsByTagName('LINK'); var output = collection[1].getAttribute('rel');