下拉框,CheckBox

来源:互联网 发布:python爬虫源码 编辑:程序博客网 时间:2024/06/06 12:34

取下拉框被选取的值:$("select[name=name]  option[selected]").text();

        $("select[name=name]  option[selected]").val();   


给下拉框赋值:$("select[name=name]  option[value='aaa']").attr("selected","selected");


---------------------------------------------------------------------------------------------





获取勾选CheckBox所在行的id:

$("input[name='box']:checked").parent().parent().attr("id");


删除CheckBox所在行:

$("input[name='box']:checked").parent().parent().remove(); 


---------------------------------------------------------------------------------------------




获取table的行数:

var tableLength = $("#dataTable").find("tr").length;

阅读全文
0 0