提问人:suman singh 提问时间:10/25/2023 最后编辑:Álvaro Gonzálezsuman singh 更新时间:10/25/2023 访问量:30
我正在创建一个文本区域,它允许用户用印地语输入。但是当我输入文本区域时,它没有显示印地语文本
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
问:
/* 在此代码中,我试图允许用户插入印地语文本,但是当用户在 textarea 字段中插入文本时,它以印地语显示*/
<!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>
答: 暂无答案
评论
<textarea>