jQuery xpath选择不起作用? [英] jquery xpath selection not working?
本文介绍了jQuery xpath选择不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一种通过xpath选择元素的方法(不是CSSpath或任何其他方法,必须严格是xpath)
I need a way to select elements via xpath (NOT CSSpath or any other method, must strictly be xpath)
$(document).find("/html[1]/body[1]/div[4]/div[2]/div[1]/h1[1]/a[1]").css("background-color", "yellow")
这似乎不起作用.
推荐答案
您可以通过以下方式直接在选择器中使用xpath:
You can use xpath directly in the selector though:
http://dev-tips.com/featured/jquery-提示使用xpath选择器
这篇关于jQuery xpath选择不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文