zoukankan      html  css  js  c++  java
  • 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);
        }

  • 相关阅读:
    1、数据加密基础
    cookie——小甜品
    使用SpringBoot开发REST服务
    从编辑距离、BK树到文本纠错
    360影视视频下载
    从Trie树到双数组Trie树
    使用websocket-sharp来创建c#版本的websocket服务
    OFFICE 文档转换为html在线预览
    IDEA+PHP+XDebug调试配置
    HTML5录音控件
  • 原文地址:https://www.cnblogs.com/mingjing/p/6101076.html
Copyright © 2011-2022 走看看