Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

checkbox default value and checked value get in jquery

//selected checkbox alert boolen value return
$('#test').click(function() {
    alert("Checkbox state (method 1) = " + $('#test').prop('checked'));
    alert("Checkbox state (method 2) = " + $('#test').is(':checked'));
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Check me: <input id="test" type="checkbox" />
  //@sujaY
Comment

PREVIOUS NEXT
Code Example
Javascript :: poll in javascript 
Javascript :: remove part of string javascript 
Javascript :: js sort number array 
Javascript :: js loader 
Javascript :: window resize next js 
Javascript :: Moment.js: Date between dates 
Javascript :: sorting in javascript 
Javascript :: arraylist to json array 
Javascript :: leaflet circle get bounds 
Javascript :: how to unselect input javascript 
Javascript :: how to set empty date in javascript 
Javascript :: first letter uppercase js 
Javascript :: use setstate in function component 
Javascript :: searching in json array mongodb 
Javascript :: repeat an array multiple times in js 
Javascript :: hexstring to rgb array js 
Javascript :: react promises 
Javascript :: Number of documents in Mongodb 
Javascript :: text.toUpperCase is not a function 
Javascript :: react-native-config 
Javascript :: javascript switch assignment 
Javascript :: Ways to iterate array in js 
Javascript :: regex all 
Javascript :: redux dispatch no connect 
Javascript :: vuejs vscode unbound breakpoint 
Javascript :: o que é jsonm 
Javascript :: find property in nested object 
Javascript :: how to use saved image on react 
Javascript :: flatmap javascript 
Javascript :: mongodb limit find node 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =