<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <title> js Activate and disable input text _ cloud-dwelling community </title> ; <meta name= "generator" content= "EditPlus"/> <meta name= "author" content= ""/> <meta name= "keywords" Content= ""/> <meta name= "description" content= ""/> <script type= "Text/javascript" > Function $ ( ID) {return document.getElementById (ID)} function editinput (tag) {obj = $ (tag); if (!obj) return false; Obj.style.backgroundColor = "#ADA8A7"; $ (' BT '). Onclick=function () {obj.disabled = false; Obj.style.backgroundColor = "#fff"; } </script> </pead> <body onload= "editinput (' Test ')" > <input type= "text" value= "test "disabled=" Disabled "id=" Test "> <input id=" BT "type=" button "value=" Modify "> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]