Created
March 28, 2012 04:49
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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