设置easyui input默认值
生活随笔
收集整理的這篇文章主要介紹了
设置easyui input默认值
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*設置input 焦點*/
$(function () {//集體調用 $(".formTextBoxes input").each(function () {$(this).setDefauleValue();});//單個調用 $(".textkey").setDefauleValue();
})//設置input,textarea默認值 .之前寫法$.fn.seDefauleValue = function(){
$.fn.setDefauleValue = function () {var defauleValue = $(this).val();$(this).val(defauleValue).css("color", "#999");return this.each(function () {$(this).focus(function () {if ($(this).val() == defauleValue) {$(this).val("").css("color", "#000"); //輸入值的顏色
}}).blur(function () {if ($(this).val() == "") {$(this).val(defauleValue).css("color", "#999"); //默認值的顏色
}});});
}
Html:
<div class="formBoxes formTextBoxes clearfix"><input id="txtSearch" type="text" value='@ViewBag.SearchText' class="searchMainBtn easyui-validatebox" /><div id="btnSearch" class="btnGo" >@ViewBag.Search</div></div>?
轉載于:https://www.cnblogs.com/8090sns/p/3180517.html
總結
以上是生活随笔為你收集整理的设置easyui input默认值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用sar进行性能分析
- 下一篇: 获取Flex SDK加载进度的方法