您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

jQuery 使用个人心得_jquery

2026/1/1 1:26:42发布13次查看
$(标签名) //取html元素 document.getelementsbytagname()
$(#id) //取单个控件document.getelementbyid()
$(div #id) //取某个控件中 控件
$(#id #id) // 通过控件id取其中的控件
$(标签.class样式名) //通过class来取控件
$(#id).val(); //取value值
$(#id).val(); //赋值
$(#id).hide(); //隐藏
$(#id).show(); //显示
$(#id).text(); //相当于取innerhtml
$(#id).text(); //相当于innerhtml=
$(#id).css(属性,值) //添加css样式
$(form#表单id).find(#所找控件id).end() //遍历表单
$(#id).load(*.html) //载入一个文件
例如:
$(form#frmmain).find(#ne).css(border, 1px solid #0f0).end() // end()返回表单
.find(#chenes).css(border-top,3px dotted #00f).end()
$.ajax({ url: result.aspx, //数据请求页面的url
type:get, //数据传递方式(get或post)
datatype:html, //期待数据返回的数据格式(例如 xml, html, script,或 json)
data: chen=h, //传递数据的参数字符串,只适合get方式
timeout:3000, //设置时间延迟请求的时间
success:function(msg)//当请求成功时触发函数
{
$(#stats).text(msg);
},
error:function(msg) //当请求失败时触发的函数
{
$(#stats).text(msg);
}
});
$(document).ready(function(){
$(#description).mouseover(function(){
//ajax方法
$.get( result.aspx, //数据请求页面的url
{ chen: 测试,age:25}, //传递数据的参数字符串
function(data){ alert(data loaded: + data); } //触发后的函数
);
});
});
//取得下拉选单的选取值
$(#testselect option:selected').text(); //取文本值
或$(#testselect).find('option:selected').text();
或$(#testselect).val();
select * from jobs a where not exists(select 1 from jobs b where a.job_idselect * from jobs a where exists(select 1 from jobs b where a.job_id
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product