Answers for "if checkbox value is true then jquery"

11

jquery if checkbox checked

$( "SELECTOR" ).attr( "checked" )  // Returns ‘true’ if present on the element, returns undefined if not present
$( "SELECTOR" ).prop( "checked" ) // Returns true if checked, false if unchecked.
$( "SELECTOR" ).is( ":checked" ) // Returns true if checked, false if unchecked.
Posted by: Guest on May-21-2020
0

if checkbox checked jquery value 1

var checked = '0';  if($('#checkbox').prop('checked')){ checked = '1'; }
Posted by: Guest on June-16-2020

Code answers related to "if checkbox value is true then jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language