Search code examples
javascriptjqueryhtmlcheckboxclickable

How do I make a checkbox unclickable *without* it being greyed out in the browser?


How do you create an HTML checkbox that is unclickable, but not greyed out? I used the disabled=disabled tag, but that makes it greyed out (in Chrome). Otherwise it works well. Working in jQuery and Rails...

Thanks.


Solution

  • Usability concerns aside:

    $("input:checkbox").click(function() { return false; });
    

    For example: http://jsfiddle.net/nKwRj/