var btn = document.querySelectorAll('button'); btn[0].onclick = function(){ }
<input type="text" > <button>send get</button> <button>send post</button>