[jQuery] 보이기, 숨기기
1. show, hideview plaincopy to clipboardprint?
- jQuery(‘#toggle’).click(function () {
- if($(“#id”).css(“display”) == “none”){
- jQuery(‘#id’).show();
- } else {
- jQuery(‘#id’).hide();
- }
- });
2. display = “block” or “none”view plaincopy to clipboardprint?
- jQuery(‘#toggle’).click(function () {
- if($(“#id”).css(“display”) == “none”){
- jQuery(‘#id’).css(“display”, “block”);
- } else {
- jQuery(‘#id’).css(“display”, “none”);
- }
- });
출처: https://rocabilly.tistory.com/71 [프로그램이 좋다]