In the following example, we hide/unhide the table using checkbox. We access the checkbox using javascript. Also the code changes the textbox ‘txtname’ to readonly <!DOCTYPE html> <html> <head> <title>Untitled document</title> <meta charset="utf-8" /> <script language="javascript" type="text/javascript"> function myfunction() { var chk = document.getElementById("chkchoice1"); var tbl = document.getElementById("tbl1"); if(chk.checked == true) { // document.writeln("It is