how can I set a value repeatedly to a field with auto clicking in javascript?

84 views Asked by At

I tried to write the auto-clicking function on a web page:

var button = document.getElementById('send_order_btnSendOrder');
setInterval(function(){button.click()}, 200)

it works correctly , now after each auto clicking i want these values will be located in fileds.

document.getElementById('send_order_txtPrice').value = "24030";
document.getElementById('send_order_txtCount').value = "5";

I mean setting values after autoclaving repeatedly. how should I change my code?

1

There are 1 answers

0
Denis Pavlov On
var button = document.getElementById('send_order_btnSendOrder').addEventListener('click', function())


And then removeEventListener('click', function())