DEV Community

Discussion on: How to change details label when open/closed without JavaScript

Collapse
 
violet profile image
Elena

Nice. For some reason I was thinking on a js solution, but this css solution most definitely works too.

Thread Thread
 
rouilj profile image
John P. Rouillard

Hi Elena:

Yeah, I try to stay away from JS whenever possible. Using CSS and HTML provides better performance.

Removing JS whenever possible makes the web less fragile.

Hence the original reason for the post. Plus this is probably more accessible as well.

-- rouilj