How to set “style=display:none;” using jQuery's attr method?

后端 未结 8 1595
闹比i
闹比i 2020-12-24 12:04

Following is the form with id msform that I want to apply style=\"display:none\" attribute to.

8条回答
  •  醉梦人生
    2020-12-24 13:02

    $(document).ready(function(){
    var display =  $("#msform").css("display");
        if(display!="none")
        {
            $("#msform").attr("style", "display:none");
        }
    });
    

提交回复
热议问题