bonaca bonaca - 4 months ago 9
HTML Question

How to turn off radio button functionality?

I want to use radio buttons just as design element, without any functionality. User should not be able to check or uncheck them.

<div id="divRadios">
<input type="radio">
<input type="radio">
...
</div>


I suppose the solution could be to place a separate, empty div over
#divRadios
and give it the higher z-index, but maybe there is a more native way ?

Answer

You might want to use the 'disabled' attribute on the radio input element:

<div id="divRadios">
<input type="radio" disabled>
<input type="radio" disabled>  
...
</div>