JQuery实验室:
[url]http://codylindley.com/jqueryselectors/[/url]
jQuery 解决冲突的办法:(发现项目中还引入了prototype.js,$发生了冲突)
参考:[url]http://www.ibm.com/developerworks/cn/web/wa-jquery1/[/url]
获取url参数
插件地址:
http://plugins.jquery.com/project/query-object
var test = $.query.get(’test’);
[url]http://codylindley.com/jqueryselectors/[/url]
jQuery 解决冲突的办法:(发现项目中还引入了prototype.js,$发生了冲突)
j$ = jQuery.noConflict();
j$("div").addClass("a");
参考:[url]http://www.ibm.com/developerworks/cn/web/wa-jquery1/[/url]
/*选择器*/
//id选择器
var userid=$("#userid");
//name选择
var date99=$("input[name='date99']");
//class选择
var deptid=$(".deptid");
/*取值*/
var textval = date99.attr("value");
//或者
//var textval = date99.val();
/*赋值*/
$("#text_id").attr("value",'text');
获取url参数
插件地址:
http://plugins.jquery.com/project/query-object
var test = $.query.get(’test’);
本文介绍了jQuery的选择器使用方法,包括ID选择器、name选择器及class选择器,并提供了实例代码。此外,还探讨了解决jQuery与其他JavaScript库冲突的方法,如与prototype.js共存时如何避免$符号冲突。
1552

被折叠的 条评论
为什么被折叠?



