
نوشته اصلی توسط
ata3929
نه من در همه نمیخوام
فقط میخوام برای این checkbox باشه
در ضمن من این کد در یک صفحه html گذاشتم و تست کردم ولی جواب نداد
این کد را استفاده کنید:
کد:
<!DOCTYPE html>
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#thischeck').click(function(){
if($(this).prop("checked") == true){
confirm("Press a button!");;
}
else if($(this).prop("checked") == false){
confirm("Press a button!");;
}
});
});
</script>
</head>
<body>
<dt><input id="thischeck" type="checkbox" id="status" name="status" value="1" />فروش</dt>
</body>
</html>