multi-language jquery switch
<p>I'm building a website in French, where some (but not all) articles are translated in English, Spanish and/or German. Each one of these articles should have a little flag representing the available translation. The idea is then that the user clicks on, say, the German flag, and the content is replaced with the German version of the text, with jquery. The flags should also disappear and be replaced with something like an X (aka a 'close' button). Once this X is clicked, the French version should again be displayed.</p>

<p>My jQuery skills being close to nil, I got this far:</p>

<pre><code>$('.flags button').click(function() {
  $("p:lang(fr)").hide();
  $("p:lang(gb)").show();
  $('span.flags').html('&lt;button type="button" class="close"&gt;&lt;/button&gt;');
});
$('button.close').click(function() {
  $("p:lang(fr)").show();
  $("p:lang(gb)").hide();
});
</code></pre>

<p>The X does not work, though I might figure it out sooner or later. Still, is there a better way to proceed?</p>

<p>Thanks a lot!</p>