How to submit a form using javascript
问题 I'm trying to click on a submit button and submit a form using purely javascript. I have tried: document.getElementById('sell_form').submit(); and for(var i=0;i<document.getElementsByName('operation').length;i++){ if(document.getElementsByName('operation')[i].value=='Sell'){ document.getElementsByName('operation')[i].submit(); } } but I just can't get it. Can anyone show me how I could do this? Thanks in advance. The web code is: <form id="sell_form" class="ajaxform" action="/member/sell"