How to do an action when a checkbox is checked with JQuery? -
I want to do one thing when a user checks the checkbox, but I can not get it to work, If I am
if ($ ("# home") is going wrong? So basically, a user goes to my page, the box Ticks (": check")) {Warning (''); }
What you are looking for is called an event. Provides simple event binding methods like jQuery
$ ("# home"). Click (function () {// this function is clicked on #home element (or tab - spacebar has changed) if ($ (this) .is (":" has been checked) // " This "refers to the element that removes the event (warning ('home is checked');}});
Comments
Post a Comment