内容目录
jquery属性用于返回当前jQuery库的版本号。
jQuery.fn.jquery属性是该属性的别名,与该属性作用相同。
该属性属于jQuery对象(实例)。
语法
jQueryObject.jquery
返回值
jquery属性的返回值是String类型,返回当前使用的jQuery库的版本号。
推荐使用jquery的别名属性jQuery.fn.jquery,因为它无需创建新的jQuery对象实例。
示例&说明
// 任意构建一个jQuery对象实例即可通过jquery属性获得版本号
document.writeln( $("ul li").jquery ); // 1.11.1
document.writeln( $(document).jquery ); // 1.11.1
// 一般使用jquery属性的别名$.fn.jquery,因为这种方式无需获得新的jQuery对象实例
document.writeln( $.fn.jquery ); // 1.11.1

0 条评论
撰写评论