Which way to test if an element is checked is better? .is(':checked') or .prop('checked')
问题 Both .is(':checked') and .prop('checked') can be used to test if a checkbox is checked. Are there any interesting/important differences between those two ways of querying the checked state or is it pretty much only a matter of personal preference? 回答1: They both end up checking the same thing. If you're using 1.6.0 or higher, prop('checked') is the most direct jQuery way. jQuery doesn't have to parse and process a selector to figure out what to do. [Note below] You can also (as of 1.6.1) use