<script type="text/javascript"> $(function() { // disable all the input boxes $(".input").attr("disabled", true); // add handler to re-enable input boxes on click $("td:has(.input)").click(function() { $(".input", this).removeAttr("disabled"); }); }); </script>