我创建了一个输入文本和输入提交的表单,我的代码工作正常,但我想知道如何在输入框中输入印地语或非英语语言? 使用输入提交是为了查看我在输入文本中输入的内容。
var field1 = document.getElementById('field1');
var resultField = document.getElementById('resultField');
var form = document.getElementById('hindiFont');
form.addEventListener('submit', function(event){
var x = field1.value;
resultField.innerText = x ;
event.preventDefault();
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>checking</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
</head>
<body>
<form id="hindiFont">
<input type="text" id="field1">
<input type="submit" value="submit">
</form>
<h3 id="resultField"></h3>
<script type="text/javascript" src="form.js"></script>
</body>
</html>