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

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -