How to use jquery on checkbox in worpdress ?
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<title>Check the Status of Checkboxes</title>
<script src=”https://code.jquery.com/jquery-1.12.4.min.js”></script>
<script type=”text/javascript”>
$(document).ready(function(){
$(‘input[type=”checkbox”]’).click(function(){
if($(this).is(“:checked”)){
alert(“Checkbox is checked.”);
}
else if($(this).is(“:not(:checked)”)){
alert(“Checkbox is unchecked.”);
}
});
});
</script>
</head>
<body>
<p><input type=”checkbox”> Check or uncheck the checkbox to get the status.</p>
</body>
</html>
<head>
<meta charset=”utf-8″>
<title>Check the Status of Checkboxes</title>
<script src=”https://code.jquery.com/jquery-1.12.4.min.js”></script>
<script type=”text/javascript”>
$(document).ready(function(){
$(‘input[type=”checkbox”]’).click(function(){
if($(this).is(“:checked”)){
alert(“Checkbox is checked.”);
}
else if($(this).is(“:not(:checked)”)){
alert(“Checkbox is unchecked.”);
}
});
});
</script>
</head>
<body>
<p><input type=”checkbox”> Check or uncheck the checkbox to get the status.</p>
</body>
</html>
Read More Posts
- How to accept image extension from url in php?
- How to fetch data (messages) in every second with ajax (setinterval) from mysql (PHP) in wordpress?
- How to extract or fetch values from textfield for php?
- How to upload file into wordpress child theme folder in wordpress ( file upload) ?
- How to insert data from dynamically created add/remove fields in wordpress $wpdb? (second method)