Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 views
in Technique[技术] by (71.8m points)

jquery - 如何使用Jquery更改css display none或block属性?(How to change css display none or block property using Jquery?)

如何使用Jquery更改css display none或block属性?

  ask by DEVOPS translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The correct way to do this is to use show and hide :

(正确的方法是使用showhide :)

$('#id').hide();
$('#id').show();

An alternate way is to use the jQuery css method:

(另一种方法是使用jQuery css方法:)

$("#id").css("display", "none");
$("#id").css("display", "block");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...