I am trying to trigger this button using javascript but I am having no luck. I have tried using getElementsByClassName but it is not working, what am I doing wrong?
<html>
<body>
<button onclick="test();"> Click</button>
<input type="button" name="vote" value=" Vote " class="Buttons" onclick="result();" />
<script>
function result(){
document.write("test");
}
function test(){
document.getElementsByClassName("Buttons").click();
}
</script>
</body>
</html>