javascript - Jquery add onchange -


i trying add onchange event normal ahref link.

currently code makes form kind of slider next , - works, not made me. @ end changes next text calculate - works.

at point need add onchange event other javascript file can math - part isnt.

here have.

if($slider.find('.rhino-active').index() == ($slider.find('.rhino-item').length -2)){                     $('.form-submit').html("calculate");                     $('.form-submit').attr(("onchange", "calculate();" ));                 } 

you setting html of elements class form-submit text (calculate). , adding onchange attribute. if elements contain text, user can not trigger change event.

you have double parentheses in attr function, should have 1 set.


Comments