Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

222
Vistas
Unable to read the value of input text in arabic language in the same way I typed in Javascript

enter image description here

I am trying to read the value of an input text field entered in the Arabic language using javascript.

But as you can see in the screenshot it's not fetching the text in the same way I typed.

The number '123' which is on the right side of the input field is jumping to the left side when I try to read the entered input field value using js code.

Please help me to solve this issue.

Below is the code that I am using:

<!DOCTYPE html>
<html lang="ar">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html:lang(ar){
            direction: rtl;
        }
    </style>
</head>
<body>
    <input type="text" dir="rtl" name="" id="textbox">
</body>
</html>

Thanks in advance :)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you output the Arabic RTL text in the console, it will be shown in the LRT direction. If you output the text in another Html field with RTL set for that field it will display correctly

Here is an example. Output the Arabic text into another field will be displayed correctly.

    <!DOCTYPE html>
    <html lang="ar">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            html:lang(ar){direction: rtl;}
        </style>
    </head>
    <body>
    <input type="text" id="inputText" oninput="outputIt()">
    <div id="outputText"></div>
    </body>

    <script>
    function outputIt() {
document.getElementById("outputText").innerHTML = document.getElementById("inputText").value;
    }
    </script>
    </html>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda