I have a link that holds a radio button, which I want to make a clickable link. I've tried:
<a href="/">
<input type="radio" style="pointer-events:none;">
</a>
This prevents anything from happening when I click the radio button. I would like it to follow the link. Any ideas?
http://css-tricks.com/almanac/properties/p/pointer-events/
To select a radio button by clicking on its text in React:Add a label element for each radio button. The htmlFor prop of each label should be set to the id of each radio button. Click on the label element to select the radio button.
You will need to set the ReadOnly property of txt1 to false in the CheckedChanged event handler for rad1 , and set it to true for the CheckedChanged event handler for all the other radio buttons. void Foo() { txt1. ReadOnly = true; // this makes the text box read-only (uneditable) txt1.
You can use JavaScript to turn elements like that into a link. E.g.:
<input type="radio" onclick="window.location='/';" />
If other elements should be combined on the link with the radio button, put the onclick
attribute on the wrapping element.
Instead of an <a>
tag, try surrounding the radio button with a <div>
with an onClick
event:
<div onClick="window.location = 'http://google.com/';">
<input type="radio" style="pointer-events:none;">
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With