js封裝函數,讓dom操做與函數分離 處理用戶名註冊實例

//處理數據函數html function check(name){dom res={};   //定義的對象,用來承載返回的數據;函數 res.state=0;  this if(name==「」){spa res.txt="用戶名不能爲空";htm return res;對象 }rem if(name.length>24){io res.txt="用戶名不能超過24個字符";function
相關文章
相關標籤/搜索