click() command not working on document.getElementsByClassName()
<p>Im making automated browser scripts with javascript and I want to use the click() command on this website but the button on the website doesnt have an Id (which works fine). However it only has a class name. When I do <code>document.getElementsByClassName(btn.btn-danger.btn-lg.btn-block.betButton).click()</code> it doesnt work.</p>

<p>Here is the inspect of the button I want to click:</p>

<pre><code>&lt;button class="btn btn-danger btn-lg  btn-block betButton" data-color="r"&gt;1 to 7, Win x2&lt;/button&gt;
</code></pre>

<p>Is it possible to use the click() function on the button? Is there someway to assign an Id myself? Thanks for any answers :)</p>

<p>I dont think that is a copy as I know what differences are. But the button doesnt have any Id only a class name. And as that doesnt work what else could I do to trigger a click() event?</p>

<p>Edit2 = There is 3 buttons with all the same class names the only difference is the text of the button and the data-color, is there any way to manipulate that?</p>