Title
$(function () {
$("input[type=button]:eq(0)").click(function () {
$("#single").val("选择2号");
});
$("input[type=button]:eq(1)").click(function () {
$("#multiple").val(["选择2号","选择3号"]);
})
$("input[type=button]:eq(2)").click(function () {
$(":checkbox").val(["check2","check3"]);//等同于$("input[type=checkbox]").filter(":eq(0),:eq(1)").attr("checked","checked")
$(":radio").val(["radio3"]);//等同于$("input[type=radio]").attr("checked","checked"),虽然是单选框,取值还是得用数组
});
});
选择1号
选择2号
选择3号
选择1号
选择2号
选择3号
选择4号
选择5号
多选1
多选2
多选3
多选4
单选1
单选2
单选3