Disable button in jQuery

Use .prop instead (and clean up your selector string): generated HTML: But the “best practices” approach is to use JavaScript event binding and this instead:

jQuery $(this) keyword

When you perform an DOM query through jQuery like $(‘class-name’) it actively searched the DOM for that element and returns that element with all the jQuery prototype methods attached. When you’re within the jQuery chain or event you don’t have to rerun the DOM query you can use the context $(this). Like so: $(this) will … Read more

JQuery – $ is not defined

That error can only be caused by one of three things: Your JavaScript file is not being properly loaded into your page You have a botched version of jQuery. This could happen because someone edited the core file, or a plugin may have overwritten the $ variable. You have JavaScript running before the page is … Read more

Disable button in jQuery

Use .prop instead (and clean up your selector string): generated HTML: But the “best practices” approach is to use JavaScript event binding and this instead: