Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery attribute selector problem: Dynamic attribute selector

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?

like image 267
ebattulga Avatar asked Oct 16 '09 14:10

ebattulga


1 Answers

You need to build the selector as a string:

$("a[href=" + $.jqURL.url() + "]").hide();
like image 78
Greg Avatar answered Oct 23 '22 21:10

Greg