Skip to content

Instantly share code, notes, and snippets.

@Tsagadai
Created March 28, 2012 04:49
Show Gist options
  • Save Tsagadai/2223731 to your computer and use it in GitHub Desktop.
Save Tsagadai/2223731 to your computer and use it in GitHub Desktop.
A simple Javascript/jQuery snippet to change textbox Arabic content to correctly display on the right. Punch this in after a pageload.
// Javascript
$("input").each(function () {
if (/[\u0600-\u06FF]/.test($(this).val())) {
$(this).addClass("right-to-left");
}
});
// CSS
.right-to-left {
text-align: right; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment