HTML objects with jQuery

I would like to replace the value of the submit button Loading….

The problem is that when I press the button, I still see …instead of three dots.

Here is my code:

$("#myid").val("Loading…");

Should I enter the ellipsis directly from the keyboard in the code above? Is it safe with UTF-8?

+3
source share
2 answers

val()or valuesets the value of plain text. …- This is HTML, not text; you can use it in innerHTMLor .html(), but not in the value of the form field.

If you want to include U + 2026 HORIZONTAL ELLIPSIS in a JavaScript string where the encoding is not guaranteed, you can avoid it:

'Loading\u2026'

keybord ? UTF-8?

.

; . , , , . () .

+16

,

\u00E1  á
\u00E9  é
\u00ED  í
\u00F1  ñ
\u00F3  ó
\u00FA  ú

\u00C1  Á
\u00C9  É
\u00CD  Í
\u00D1  Ñ
\u00D3  Ó
\u00DA  Ú

, , \uVALUE JS:) http://jsfiddle.net/tomasdev/VjAkJ/

+3

Source: https://habr.com/ru/post/1717565/


All Articles