Use anchor element without href to toggle “hidden” attribute of separate element (div), without JavaScript

54
June 13, 2018, at 2:30 PM

I've been browsing with JS disabled in my browser lately, out of curiosity to see how some sites handle it, and found some functionality on one site in particular that doesn't seem like it would be possible, based on what I know.

More context can be given if helpful, but the snippet of the source looks like:

<a class="expando-button toggleImage video-muted collapsed collapsedExpando" title="" data-host="gfycat"></a>

^^ This is the markup for a small little icon, that when clicked, removes the hidden attribute from a sibling div element, a few siblings away:

<div hidden="" class="res-expando-box" style="min-height: 20px" data-host="gfycat">
            <div class="res-expando-box-inner"></div>
        </div>

^^Nested inside of that div somewhere is a video element, that displays a gif. When the anchor element is clicked, the "hidden" attribute is toggled on/off in that outer div, and I can't figure out the mechanism by which that happens.

None of the CSS that I can see in Chrome's dev tools for any of the classes in those elements gives me any clues about anything to do with a "hidden" attribute, and I can't find anything in CSS or HTML docs that would lead to me figure out how such a thing would be possible.

Obviously, it might be difficult to say exactly how this is being accomplished without knowing a lot more about this particular context, but I was hoping for some general ideas of just how one might accomplish such a thing.

So, more generally, is there a way to use an anchor element to toggle an attribute of a separate element, without an "href" attribute of said anchor element, and without JavaScript?

READ ALSO
flaticons not showing up in digitalocean - Ruby On Rails application

flaticons not showing up in digitalocean - Ruby On Rails application

I'm using following directory structure as shown in and added the following code in config/applicationrb but flaticons are not showing up in staging server digitalocean while working great on localhost

30
Sass-loader not replacing variables?

Sass-loader not replacing variables?

Not too long ago I made a project that used a combination of SASS variables and CSS custom propertiesI defined my Sass variables and then used those to create my CSS custom properties

69
Bootstrap width whitespace issue avilon theme

Bootstrap width whitespace issue avilon theme

I having issues that you can drag website to left and it seems like width is larger than viewport

42
Get child and sub child nodes in html with javascript

Get child and sub child nodes in html with javascript

I have a grid made in html like so

59