EasyUI 搜索框

来源:互联网 发布:不用网络的电视软件 编辑:程序博客网 时间:2024/06/06 01:01
<html><head><title>draggable</title><link rel="stylesheet" type="text/css" href="H:/jQuery EasyUI/jquery-easyui-1.5.3/themes/default/easyui.css"><link rel="stylesheet" type="text/css" href="H:/jQuery EasyUI/jquery-easyui-1.5.3/themes/icon.css"/><script type="text/javascript" src="H:/jQuery EasyUI/jquery-easyui-1.5.3/jquery.min.js"></script><script type="text/javascript" src="H:/jQuery EasyUI/jquery-easyui-1.5.3/jquery.easyui.min.js"></script><script>$(function (){$('#s').searchbox({/*width number:设置组件的宽度*/width:200/*searcher e:当搜索按钮被点击时执行*/,searcher:function(value,name){   alert(value);},/*value stirng:搜索框默认值prompt string:搜索框提示信息*/prompt:'请输入搜索内容'/*menu selector:通过选择器添加搜索菜单*/,menu:'#m'}); /*menu none:返回搜索框属性对象textbox none:返回搜索框属性对getValue none:返回当前搜索关键字setValue value:设置搜索的关键字selectName name:设置搜索菜单类型getName:none:获取搜索菜单类型destroy none:清除搜索框组件*/var propertiesJSON = $('#s').searchbox('options');var properties = "";for(var item in propertiesJSON) {properties = properties +item+"属性的值:"+propertiesJSON[item] + ";\n";}alert(properties);$('#s').searchbox('setValue','jQuery EasyUI');alert($('#s').searchbox('getValue'));})</script></head><body><input type="text" id="s" name="eachName" /><div id="m" style="width:150px"><div data-options="name:'method1',selected:true">百度</div><div data-options="name:'method2'">搜狗</div></div></body></html>

原创粉丝点击