I do not see another option for adding a block layer <div> on top of the checkbox. Therefore, the solution should be as follows:
function addDisabledClickHandler(el, handler) { $("<div />").css({ position: "absolute", top: el.position().top, left: el.position().left, width: el.width(), height: el.height() }).click(handler).appendTo("body"); } var el = $("input[type='checkbox']"); addDisabledClickHandler(el, function() { alert("Clicked"); });
DEMO: http://jsfiddle.net/q6u64/
VisioN
source share