.prop(property)
.prop(property, value)
.prop(object)
.prop(function)
$(function(){ $("#startBtn").click(function(){ $(this).prop("disabled",true); $("#stopBtn").prop("disabled",false); }); $("#stopBtn").click(function(){ $(this).prop("disabled",true); $("#startBtn").prop("disabled",false); }); });
$(function(){ $("#s2Check").change(function(){ if($(this).prop("checked")){ $("#s2Btn").prop("disabled", false); } else { $("#s2Btn").prop("disabled", true); } }); });
$(function(){ $("#s3Btn").click(function(){ if($("#s3Check").prop("checked")){ alert("OK"); } else { alert("No"); } }); });
$(function(){ $("#allCheck").change(function(){ if($(this).prop("checked")){ for(var i=0; i<5; i++){ document.s4chbox.elements[i].checked = true; } } else { for(var j=0; j<5; j++){ document.s4chbox.elements[j].checked = false; } } }); });
$(function(){ $("input[name='s5Check']").change(function(){ var s5Array = new Array(); $("input[name='s5Check']:checked").each(function(){ s5Array.push($(this).val()); }); console.log(s5Array); }); });
$("div").click(function(){ var thisId = $(this).prop("id"); var thisClass = $(this).prop("class"); var thisName = $(this).prop("name"); console.log(thisId + "," + thisClass + "," + thisName); });
function s7Func(){ var s7Obj = new Object(); s7Obj.title = "sample7"; s7Obj.id = "s7Id"; s7Obj.class = "s7Class"; s7Obj.type = "checkbox"; s7Obj.value = "sample7"; s7Obj.checked = true; $("#s7Btn").on("click", function(){ $("#s7Input").prop(s7Obj).after(s7Obj.value); }); }
$(function(){ $("input[value='ccc']").prop("checked", true); });