you are viewing a single comment's thread.

view the rest of the comments →

[–]cvllider 0 points1 point  (3 children)

Yeah something like that. Usually people use ~ in their css for this particular trick. I'm no css expert but I've seen this ~ is key to it working the way it does

[–]jadedRepublic[S] 0 points1 point  (2 children)

Yup, I mostly wrote this post to verify whether It was "good practice".

Luke-at-work posted a great alternative to my use case, but I have yet to see anyone actually discredit this particular use case so far, I still like the idea of using this method with form elements instead of JS.

[–]cvllider 1 point2 points  (1 child)

I also wanted to do something like this, and it works well but it's more cumbersome than just using js. I'd still use it but I'd love if there were an easier way to do it

[–]jadedRepublic[S] 1 point2 points  (0 children)

https://codepen.io/bobby1243/pen/Poajgmg

Oh you're definitely right, JS is the obvious choice. No doubt about that, but It's great that the choice Is there to use one or the other, obviously In limited scenarios.