I have the following piece of html code:
<div class ="listit">
<a href="javascript:dB()">Update</a>
<a href="post.php?f=54&y=5">New iso</a>
<a href="post.php?f=54&y=2">New check></a>
</div>
Now I like to press the button called Update by using its name (but I'm also very interested to see if it works without using its name).
I have already tried to go through the class and collect the names using loop:
var x = document.getElementsByClassName("listit");
for (var i = 0; i < x.length; i++) {
var counter = x[i].innerText;
if(counter == "Update"){
}
}
And I think I almost have it, I just could not find a working way to use that click() function so I click the button Update by name? There is not something like document.getElementByInnerText()? I don't know how to get this work..? :S

listitclass so your code will not work at all.