开发者

jquery attribute selector problem: Dynamic attribute selector

开发者 https://www.devze.com 2022-12-08 12:29 出处:网络
My code is here $(\"a[href=$.开发者_开发百科jqURL.url()]\").hide(); $.jqURL.url() return current page url.

My code is here

$("a[href=$.开发者_开发百科jqURL.url()]").hide();

$.jqURL.url() return current page url.

But this code don't work

Is it possible to select dynamically?


You need to build the selector as a string:

$("a[href=" + $.jqURL.url() + "]").hide();
0

精彩评论

暂无评论...
验证码 换一张
取 消