I have a problem that I do not know how to solve. I attach the code snippet
<li id="menu-item-61" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-61">
<a href="https://twitter.com/loquesea">
<i class="icon-twitter"></i>
</a>
</li>
The problem is that I need to add the target to a new tab on that link because I can not directly touch the html code.
I had created the following code:
function cambiatarget() {
var links = document.getElementsByTagName("a");
for (var i = 0; i < links.length; i++) {
links[i].target = "_blank";
}
}
cambiatarget();
But the problem as it is logical is that I vary all the a
of the page. How could I access that link only?