css實(shí)現(xiàn)input不可編輯的方法:1、設(shè)置【onfocus=this.blur()】當(dāng)鼠標(biāo)放不上就離開焦點(diǎn);2、設(shè)置disabled,代碼為【<..name="input1" value="()" disabled="true">】。
本教程操作環(huán)境:windows7系統(tǒng)、css3版,DELL G3電腦。
css實(shí)現(xiàn)input不可編輯的方法:
方法1:onfocus=this.blur() 當(dāng)鼠標(biāo)放不上就離開焦點(diǎn)
<input type="text" name="input1" value="()" onfocus=this.blur()>
方法2:readonly
<input type="text" name="input1" value="()" readonly> <input type="text" name="input1" value="中國" readonly="true">
方法3:disabled
<input type="text" name="input1" value="()" disabled="true">
擴(kuò)展資料:
語法Input(number, [#]filenumber)Input 函數(shù)的語法具有以下幾個部分:部分描述number必要。任何有效的數(shù)值表達(dá)式,指定要返回的字符個數(shù)。filenumber必要。任何有效的文件號。說明通常用 Print # 或 Put 將 Input 函數(shù)讀出的數(shù)據(jù)寫入文件。
Input 函數(shù)只用于以 Input 或 Binary 方式打開的文件。與 Input # 語句不同,Input 函數(shù)返回它所讀出的所有字符,包括逗號、回車符、空白列、換行符、引號和前導(dǎo)空格等。對于 Binary 訪問類型打開的文件,如果試圖用 Input 函數(shù)讀出整個文件,則會在 EOF 返回 True 時產(chǎn)生錯誤。
相關(guān)教程推薦:CSS視頻教程