Due to a plugin being used, I can’t add the “onClick” attribute to the HTML form inputs like usual.
A plugin is handling the forms part in my site and it doesn’t give an option to do this automatically.
Basically I have this input:
<input type="text" id="bfCaptchaEntry" name="bfCaptchaEntry" style="">
I want to add an onClick to it with jQuery onload for it to be like this:
<input onClick="myfunction()" type="text" id="bfCaptchaEntry" name="bfCaptchaEntry" style="">
How do I go about doing this?
I know this might not be standard practice but seems like the easiest option to do in my situation.
I’m a newbie to jQuery so any help is very much appreciated.
You can use the
clickevent and call your function or move your logic into the handler:You can use the
clickevent and set your function as the handler:.click()
http://api.jquery.com/click/
You can use the
onevent bound to"click"and call your function or move your logic into the handler:You can use the
onevent bound to"click"and set your function as the handler:.on()
http://api.jquery.com/on/