As a newbie blogger delving into the world of HTML, my knowledge of JavaScript is quite limited. I am eager to find out how I can hide any div on a webpage simply by adding a parameter to the URL; for example, if I were to add ?hide=header-wrapper at the end of the URL, it should effectively conceal the header-wrapper from view. Is this achievable with JavaScript?
I am seeking the correct code to accomplish this task and would also like to know whether it is possible for the code to automatically detect and hide any div specified in the URL (such as ?hide=divID
).
Your assistance in providing the necessary guidance would be highly appreciated. Thank you in advance.