• jquery


    js outerHTML

    $(".test").prop("outerHTML");

    在jQuery1.6版本之后,取复选框有没有被选中,要用prop

    $(".grid :checkbox").attr("checked", false); 改成  $(".grid :checkbox").prop("checked", false);

    select

    $(document).ready(function() {
            //绑定下拉框change事件,当下来框改变时调用 SelectChange()方法
            $("#selectID").change(function() { SelectChange(); }); 
            })
            function SelectChange() {
            //获取下拉框选中项的text属性值
            var selectText = $("#selectID").find("option:selected").text();
            alert(selectText);
            //获取下拉框选中项的value属性值
            var selectValue = $("#selectID").val();
            alert(selectValue);
            //获取下拉框选中项的index属性值
            var selectIndex = $("#selectID").get(0).selectedIndex;
            alert(selectIndex);
            ////获取下拉框最大的index属性值
            var selectMaxIndex = $("#selectID option:last").attr("index");
            alert(selectMaxIndex);
        }

  • 相关阅读:
    列表常用方法及演示
    print >> 重定向
    简单字符串过滤练习
    None,Python 的 Null 对象,布尔值
    Time模块简单学习
    str()与repr(),input()与raw_input()
    布尔数,__nonzero__()
    字符串内建函数
    标准类型内建函数
    客户端precommit hook参数
  • 原文地址:https://www.cnblogs.com/mingjing/p/6101076.html
Copyright © 2020-2023  润新知