<input type="checkbox" onclick="document.getElementById('txt').disabled=!this.checked" /> <input type="text" id="txt" />