Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I navigate to hidden anchors?

I have a hidden element on my page with id select-box:

<select style="display:none;" id="select-box">

There's a <label> at the top of my page:

<label for="select-box">Select box</label>

Because the <select> is hidden, clicking on the <label> has no effect. Is there a way to achieve this, preferably without using any JavaScript?

like image 563
Bas Peeters Avatar asked Feb 01 '26 23:02

Bas Peeters


1 Answers

The css feature display:none; removes the element from the document.

try:

style="visibility:hidden; width:0px"

visibility:hidden keeps the element in the dom and also takes up space so I've given a width of 0px to ensure no blank space will remain.

like image 152
KpTheConstructor Avatar answered Feb 03 '26 11:02

KpTheConstructor