<div class="codetitle"> <span><a style="CURSOR: pointer" data="76375" class="copybut" id="copybut76375" onclick="doCopy('code76375')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code76375"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><머리> <br><제목> 새 문서 </title> <br><meta name="generator" content="editplus" /> <br><meta name="author" content="" /> <br><meta name="keywords" content="" /> <br><meta name="description" content="" /> <br></head> <br><br><본문> <br><!DOCTYPE html> <br><html lang="ko"> <br><머리> <br><meta charset="UTF-8" /> <br><제목></제목> <br><link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" /> <br><script type="text/javascript" src="../../jquery-1.4.2.js"></script> <br><script type="text/javascript" src="../../external/jquery.bgiframe-2.1.1.js"></script> <br><script type="text/javascript" src="../../ui/jquery.ui.core.js"></script> <br><script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script> <br><script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script> <br><script type="text/javascript" src="../../ui/jquery.ui.draggable.js"></script> <br><script type="text/javascript" src="../../ui/jquery.ui.position.js"></script> <br><script type="text/javascript" src="../../ui/jquery.ui.ressible.js"></script> <br><script type="text/javascript" src="../../ui/jquery.ui.dialog.js"></script> <br><link type="text/css" href="../demos.css" rel="stylesheet" /> <br><script type="text/javascript"> <br>$(function() { <br>//初始测试数据 <br>var init=function(){ <br>$("#con1").add("#con3").data("key ","10001"); <br>}; <br>init(); <br>var select="mytest"; <br>var name="key"; <br>//정义一个新选择器 <br>$.expr[ ":" ][ select ] = function( elem ) { <br>return !!$.data( elem, name ) <br>}; "div:mytest").each(function(){ <br>alert(this.id);//结果:con1 con3 <br>}) <br>}); <br></script> <br></head> <br><본문> <br><div id="con1"></div> <br><div id="con2"></div> <br><div id="con3"></div> <br></body> <br></html> <br><br></body> <br></html> <br><br> </div>