issue in virtual keyboard
-
19-06-2021 - |
Pergunta
i have a script which is for virtual keyboard, i am facing some problem while creating a keys for superscript and subscript.For eg. while i am using <'sup'>3<'/sup'>
in my span class it displays it right,but when i am pressing that key it also prints <'sup'>3<'/sup'>
in textbox.
so what should i need to change in jquery ?
Here is my working code.
HTML CODE :
<li class="symbol"><span class="off"><sup>11</sup></span><span class="on"><sup>11</sup></span></li>
JQuery CODE
// Special characters
if ($this.hasClass('symbol')) character = $('span:visible', $this).html();
Full Code :
Solução
Change your code to:
if ($(this).hasClass('symbol'))
character = $('span:visible', $(this)).html();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow