+ -
当前位置:首页 → 问答吧 → 新版本JQ不能使用Xpath定位元素

新版本JQ不能使用Xpath定位元素

时间:2009-04-27

来源:互联网

新版本JQ不能使用Xpanth定位元素了,当需要对元素里的属性进行模糊定位的时候应该怎么办呢:?
  $(document).ready(function(){
  $('div.chapter a[@href*=wikipedia]').each(function(index){         这里的div.chapter a[@href*=wikipedia]  采用的是Xpath找到< a href=里包含wikipedia的url连接地址。应该采用什么方法来达到这个效果呢?
  var $thisLink=$(this);
  $(this).attr({'rel':'external',
  'id':'wikilink-'+index,
  'title':'learn mor about'+$thisLink.text()+'at Wikipedia'});
  });
  });

作者: dwtmtdh   发布时间: 2009-04-27

相关阅读 更多

热门下载

更多