久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

angular.js - ng-show 表達式動態顯示

瀏覽:141日期:2024-09-30 14:07:39

問題描述

form input輸入框點擊搜索框顯示提示內容,點擊其他地方,提示內容消失

代碼見下

<form name='checkForm'> <p class='form-group'><label class='col-sm-3 control-label'>用 戶 名</label><p class='col-sm-8 account'> <input type='text' placeholder='您的賬戶名和登錄名'ng-model='account'name='account'required='required'ng-pattern='regularList.account'ng-blur='checkForm.account.$blured = true;'ng-focus='checkForm.account.$blured = false;'autocomplete='off'/> <span ng-class='{’right’:(checkForm.account.$error.pattern),’error’:checkForm.account.$valid}'></span></p> </p> <p ng-show='checkForm.account.$blured'><p class='input-tip'> <i></i> <span>!支持中文、字母、數字、“-”“_”的組合,4-20個字符</span></p> </p></form>

具體效果見下angular.js - ng-show 表達式動態顯示

當我點擊搜索框時,提示內容顯示angular.js - ng-show 表達式動態顯示

求指導,謝謝

問題解答

回答1:

ng-blur和ng-focus的表達式寫反了吧?還有變量里邊有必要加入$blured么?隨便一個變量都能標記是否獲得焦點吧,你再看看。

相關文章:
主站蜘蛛池模板: 凤阳县| 乌恰县| 陈巴尔虎旗| 隆林| 大石桥市| 大洼县| 郴州市| 波密县| 武穴市| 正阳县| 汝南县| 玉田县| 湖北省| 突泉县| 华蓥市| 固安县| 义马市| 湟源县| 建湖县| 拜城县| 普兰店市| 三明市| 阿瓦提县| 平遥县| 宿州市| 龙岩市| 韶山市| 仁寿县| 西充县| 嘉黎县| 合川市| 阆中市| 商河县| 潜山县| 营口市| 卓尼县| 宣威市| 苍南县| 鹿泉市| 东方市| 勃利县|