First question on stack, so hurray to me! I'm trying to develop a new way (apparently, since I've seen no solution to this online, perhaps cos it's not possible) to change the language of HTML written elements using JS and the lang property.
Basically, I have created multiple tags with the lang property in each of them, so that giving the certain lang a display value of -none-, hides it, and a value of -inherit- to show it. In that way, using the line:
a:lang(en),p:lang(en) { display : none }
a:lang(it),p:lang(it) { display : inherit }
I can see one language at a time. And that works!
Now, I have created an
<a href="" lang="en" id="en"> word </a>
tag around the english text, and the same with any other language with their own lang property. I have tried to use:
$("#en").click(function(){
$('a:lang(en)').css('display', 'inherit');
$('a:lang(it)').css('display', 'none');
};
Which doesn't seem to work.
Any ideas?
Thanks a bunch, Shay