JQuery .show() vs .css('display', 'block)
2020. 7. 13. 09:27ㆍJavaScript/JQuery
728x90
https://stackoverflow.com/questions/3641532/whats-the-difference-between-show-and-cssdisplayblock
Assuming you have this at the beginning:
<span id="thisElement" style="display: none;">Foo</span>
when you call:
$('#thisElement').show();
you will get:
<span id="thisElement" style="">Foo</span>
while:
$('#thisElement').css({'display':'block'});
does:
<span id="thisElement" style="display: block;">Foo</span>
so, yes there's a difference.
728x90
반응형
'JavaScript > JQuery' 카테고리의 다른 글
PHP ajax force_download only shows in browser (0) | 2021.01.13 |
---|---|
jquery append, after 차이 (0) | 2020.08.31 |
event binding on dynamically created elements (0) | 2020.08.12 |
JQuery event.preventDefault() 용도 (0) | 2020.08.12 |
jquery remove duplicate elements (0) | 2020.08.11 |