How to make disabled/readonly functionality for radio buttons and checkboxes

css, html, javascript, jquery

Solution

You can use the following code to avoid clicks on elements you don't want user to change

$(':radio,:checkbox').click(function(){
    return false;
});

You can use proper selector to limit the clicks.

Problem

I know we can't make readonly radio button and checkbox. I tried to disable radio button and checkbox but in IE it is not visible. Is any alternative way to do the same like disabled / readonly using jQuery, CSS, JavaScript?

Original source

Related problems