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
Post a Comment