Using jQuery display the checked attribute and property of a checkbox as it changes
- جي كويري
- 2021-09-17
- mhanasmh00489829403
الأجوبة
HTML Code :
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Using jQuery display the checked attribute and property of a checkbox as it changes.</title>
</head>
<body>
<input id="check1" type="checkbox" checked="checked">
<label for="check1">Check me</label>
</body>
</html>
JavaScript Code :
$( "input" )
.change(function() {
var $input = $( this );
console.log(".attr( 'checked' )");
console.log(".prop( 'checked' ): " +$input.prop( "checked" )) ;
console.log(".is( ':checked' ): " + $input.is( ":checked" ) );
})
.change();
القوائم الدراسية التي ينتمي لها السؤال
معلومات ذات صلة