<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title>newdocument</title>
<metaname="generator"content="editplus"/>
<metaname="author"content=""/>
<metaname="keywords"content=""/>
<metaname="description"content=""/>
</head>
<body>
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="UTF-8"/>
<title></title>
<linktype="text/css"href="../../themes/base/jquery.ui.all.css"rel="stylesheet"/>
<scripttype="text/javascript"src="../../jquery-1.4.2.js"></script>
<scripttype="text/javascript"src="../../external/jquery.bgiframe-2.1.1.js"></script>
<scripttype="text/javascript"src="../../ui/jquery.ui.core.js"></script>
<scripttype="text/javascript"src="../../ui/jquery.ui.widget.js"></script>
<scripttype="text/javascript"src="../../ui/jquery.ui.mouse.js"></script>
<scripttype="text/javascript"src="../../ui/jquery.ui.draggable.js"></script>
<scripttype="text/javascript"src="../../ui/jquery.ui.position.js"></script>
<scripttype="text/javascript"src="../../ui/jquery.ui.resizable.js"></script>
<scripttype="text/javascript"src="../../ui/jquery.ui.dialog.js"></script>
<linktype="text/css"href="../demos.css"rel="stylesheet"/>
<scripttype="text/javascript">
$(function(){
//初始测试数据
varinit=function(){
$("#con1").add("#con3").data("key","10001");
};
init();
varselect="mytest";
varname="key";
//定义一个新选择器
$.expr[":"][select]=function(elem){
return!!$.data(elem,name);
};
//使用
$("div:mytest").each(function(){
alert(this.id);//结果:con1con3
})
});
</script>
</head>
<body>
<divid="con1"></div>
<divid="con2"></div>
<divid="con3"></div>
</body>
</html>
</body>
</html>