jquery - Using trigger() to check a checkbox, how can I tell if it's checked or not without the checked="checked" being set? -
jquery - Using trigger() to check a checkbox, how can I tell if it's checked or not without the checked="checked" being set? -
using jquery 1.9.0, if utilize .trigger('click')
on checkbox, checked
attribute not set. there way else can tell if checkbox checked then? right now, have explicitly handle click event , manually toggle attribute. jquery supposedly simplifying javascript, seems long way go it.
i used not have in 1.8.3, in 1.9.0, setting attribute doesn't update display in browser whatever reason.
check property, not attribute. attribute isn't useful.
$(checkbox).prop("checked") // true if checked, false otherwise $(checkbox).prop("checked",true) // create checked $(checkbox).prop("checked",false) // create not checked
edit comment:
there's selector that:
$(".mycheckboxes:checked")
jquery
Comments
Post a Comment