0

How to create two input, when I write characters in input1, show in input2 into circle?

30th Jun 2017, 7:16 AM
Mahsa Jooya
Mahsa Jooya - avatar
4 Antworten
+ 3
<input type="text" id="inp1" onchange="document.getElementById('inp2').value=this.value;"> <input type="text" id="inp2" onchange="document.getElementById('inp1').value=this.value;">
30th Jun 2017, 7:55 AM
visph
visph - avatar
+ 3
Use method charCodeAt() or charPointAt(): alert("test".charCodeAt(2)); ... will output the code char of 's' in decimal format (you have to format it to hexadecimal if needed) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt charPointAt() is required for unicode char stored on more than 2 octets (16bits)...
30th Jun 2017, 9:39 AM
visph
visph - avatar
0
but how to write code if I write "a" in input1 , in input 2 show the unicode of chracter "a" that it is "&#9398;"???
30th Jun 2017, 8:09 AM
Mahsa Jooya
Mahsa Jooya - avatar
0
Thank you so much "visph "
30th Jun 2017, 9:43 AM
Mahsa Jooya
Mahsa Jooya - avatar