0

I want create a script for auto click button on planned time. Example: I want click a button in hour X in a web page (reload every hour). THe problem is about identify that button with ClassName and onClick, onClick function's identify button.

How can I do?

HTML CODE: <button class="reward_link_redeem_button_style " onclick="RedeemRPProduct('free_points_100')">REDEEM</button>

Thanks

1 Answers1

0

Change the callback to pass this as well

<button class="reward_link_redeem_button_style" onclick="RedeemRPProduct(this, 'free_points_100')">click</button>

in the callback, the first argument (this, will be the button element)

function RedeemRPProduct (element, whatever) {
  element.className == "reward_link_redeem_button_style"
}
Tyler Sebastian
  • 9,067
  • 6
  • 39
  • 62
  • Thanks for reply, so do I modify html web page or must I add this in a script? Another question, How I can automated click in a fixed time of redeem button? – Federico banfi Aug 02 '18 at 15:54