The code copy is as follows: if( document.getElementById("div").css("display")==='none') if( document.getElementById("div").css("display")==='block') $("#div").is(":hidden"); // Determine whether it is hidden $("#div").is(":visible")