zoukankan      html  css  js  c++  java
  • jquery显示、隐藏div的方法

    $("#top_notice").css("display", "block");//第1种方法
    //$("#top_notice").attr("style", "display:block;");//第2种方法
    //$("#top_notice").show();//第3种方法
    

      1.给元素换class,来实现隐藏div,前提是换的class样式定义好了隐藏属性

    $("#sendPhoneNum").attr("class", "n_input3");
    

      1.2给元素设置style属性

    $("#top_notice").attr("style", "display:block;");
    

      2.通过jquery的css方法,设置div隐藏

    $("#sendPhoneNum").css("display", "none");
    

      3.通过jquery的show()、hide()方法,设置div隐藏

    $("#textDiv").show();//显示div
    $("#imgDiv").hide();//隐藏div
    

      

  • 相关阅读:
    作业练习
    作业练习
    作业
    作业
    作业
    作业
    作业
    作业
    作业
    作业
  • 原文地址:https://www.cnblogs.com/azhqiang/p/4428298.html
Copyright © 2011-2022 走看看