質問

In the below example I'm using jQuery's toggleclass to make a box look different when the #button is clicked.

$("#button").click(function () {
  $(".box").toggleClass("box-toggle");
});

I know that I can use "hover" instead of "click", but I'd like to know the full list of what I can say there aside from hover and click.

Is there a full list of these actions states in jQuery/Javascript somewhere? Is there a "checked" for radio/checkboxes?

Thanks

役に立ちましたか?

解決

Category: Events These methods are used to register behaviors to take effect when the user interacts with the browser, and to further manipulate those registered behaviors.

EVENTS LIST

Also there is checked method to check if radio button is checked or not

$('#element').click(function() {
   if($('#radio_button').is(':checked')) { alert("it's checked"); }
});

他のヒント

Check out jQuery's event selectors:

http://api.jquery.com/category/events/

Event selectors: http://api.jquery.com/category/events/

As for the checked you can do:

$('#radioID').is(':checked') and it will return true/false

Take a look at this : http://api.jquery.com/category/events/

The page contains a bit more info than you want but you will easily find what you need!!

The jQuery API will help you with these.

For example for button events, see this page. It is the full list of possible mouse events.

For radio- and checkboxes, you can see the checekd selector also linked from the same page - i can't post a link, as I need more reputation to most more than two links.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top