In this post, you will learn how to change an element's display property value from none to block using JavaScript or JQuery.

Change display none to block using JavaScript. #

Using the JavaScript style.display property, we can hide an element and also show the element.

To show an element, simply use the style.display="block" and to hide an element, use the style.display="none".

Example : show and hide div element #
// hide element
document.querySelector('.my-div').style.display="none";

// show element
document.querySelector('.my-div1').style.display="block";
Try it Yourself »

Change display value to none using JQuery. #

We can also change the display property value from block to none using css() method in JQuery.

Example : hide div element using JQuery. #
 <script>
   $('.my-div').css('display','none')
 </script>
Try it Yourself »