Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72443

Triggering a link via a checkbox in only HTML and Javascript

$
0
0

Is there a way of launching a link from clicking/tapping on a checkbox with only HTML and CSS (no JavaScript)?

I'm scripting something for personal use and looking for a way to launch a URL scheme by checking a checkbox.

It is trivial to write a checkbox that "has" a link:

<a href="kmtrigger://macro=some%20macro"><input type="checkbox" name="checkbox" id="done" value="value"></a> Test

Hovering over the checkbox reveals the link (as shown in this CodePen sample of the above code). Still, I cannot get the link to launch. It seems like the checkbox action "absorbs" clicks.

I have tried giving the link a higher z-index, but it had no effect.

(There are other ways of achieving this that I will probably pursue, but this is the simplest if it is possible!)


Viewing all articles
Browse latest Browse all 72443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>