<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <h3>禁止输入</h3> <input type="text" value="禁止输入" id="disInput"> <script> var textinput=document.getElementById("disInput"); textinput.onfocus=function(){ this.blur(); } </script> </body> </html>