jquery - find a tag that contains the window.location.href -


in order replace text displays language on page, want find 'a' tag contains window.location.href url , set text current language text

i've tried doing: a[href=window.location.href] doesn't work

var href = window.location.href; var currentlangval = jquery('.countryselector a[href=href ]').text(); jquery('.language-display').text(currentlangval); 

what need string concatenation, in case, want value of href variable, , not "href" itself.

var href = window.location.href; var currentlangval = jquery('.countryselector a[href="' + href + '"]').text(); jquery('.language-display').text(currentlangval); 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -