{"id":4674,"date":"2025-08-09T17:34:55","date_gmt":"2025-08-09T16:34:55","guid":{"rendered":"https:\/\/ibex.tech\/wordpress-sites\/?p=4674"},"modified":"2025-08-09T17:36:00","modified_gmt":"2025-08-09T16:36:00","slug":"show-hide-section-by-id","status":"publish","type":"post","link":"https:\/\/ibex.tech\/wordpress-sites\/page-builders\/elementor\/javascript\/show-hide-section-by-id","title":{"rendered":"Show \/ hide section by ID"},"content":{"rendered":"\n<p>You can use .style.display as normal, just make sure when you show it you are using &#8216;flex&#8217; and not &#8216;inline&#8217; if the element is a flex!<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Hide it:<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>  document.getElementById('MyId').style.display = 'none';<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Show it<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>  document.getElementById('MyId').style.display = 'inline';\n\/\/or\n  document.getElementById('MyId').style.display = 'flex';<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can use .style.display as normal, just make sure when you show it you are using &#8216;flex&#8217; and not &#8216;inline&#8217; if the element is a flex! Hide it: Show it<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[385],"tags":[],"class_list":["post-4674","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/comments?post=4674"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4674\/revisions"}],"predecessor-version":[{"id":4676,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4674\/revisions\/4676"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/media?parent=4674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/categories?post=4674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/tags?post=4674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}