i am creating a textarea,which allows user to input in hindi language. But when i am entering in textarea it is not showing text in hindi language

46 views Asked by At

/* in this code i am trying to allow user to insert text in hindi language but when user insert text in textarea field it is showing in hindi*/

    <!DOCTYPE html>
        <html lang="hi">
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>Hindi Text Input</title>
        </head>
        <body>
            <h1>हिंदी टेक्स्ट इनपुट (Hindi Text Input)</h1>
            <label for="hindi-textarea">टेक्स्ट इनपुट:</label><br>
            <textarea id="hindi-textarea" name="hindi-input" rows="4" cols="50"></textarea>
        
            <div id="output"></div>
        
            <script>
               
                const hindiTextarea = document.getElementById("hindi-textarea");
                const outputDiv = document.getElementById("output");
        
                hindiTextarea.addEventListener("input", function()
                {
                    const inputText = hindiTextarea.value;
                    outputDiv.textContent = "आपका इनपुट: " + inputText;
                });
            </script>
        </body>
        </html>

0

There are 0 answers