0 votes
in HTML by
Hide or show elements in HTML using display property

1 Answer

0 votes
by

Style display property is used to hide and show the content of HTML DOM by accessing the DOM element using JavaScript/jQuery.

To hide an element, set the style display property to “none”.

document.getElementById("element").style.display = "none";

To show an element, set the style display property to “block”.

document.getElementById("element").style.display = "block";
  1. Steps to show the working of style display property:
  2. Create some div and assign them an id or class and then add styling to it.
    filter_none

    brightness_4

    <div class="circle" id=<code class="string" style='margin: 0px !important; padding: 0px !important; border: 0px !important; font-size: 0.99em !important; vertical-align: baseline !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier,
...