Polyglot Language Selector 2 - using the id's

I'm using Polyglot Language Selector 2 and its working well - however, I have a question:

It utilises the following: data-lang-id="en_US"

Is it possible to use that within jQuery as a specific ID? If so, how would I achieve that, for example:

if($("#data-lang-id").val("English")){
        //alert("English");

    }

The above doesn't work and I am not surprised as it's not unique to "en_US".

Any advice, what am I missing?

Answers


Try:

if ( $('div[data-lang-id="English"]').length ) {
  alert('English!');
}

http://jsfiddle.net/rkxxc5cu/


Need Your Help

JNA with 32bit JVM on a 64bit OS

java windows-7 32bit-64bit jna

I want to upgrade a device using a proprietary library (DLL) that I developed. The library works fine using a MFC app. However, the twist here is that we must make this work in a browser.

Python: list vs. np.array: switching to use certain attributes

python arrays list numpy type-conversion

I know, there are plenty of threads about list vs. array but I've got a slightly different problem.