I am using the following code.
HTML Code :
I am getting
× in alert. I need to get
× as result.
Anybody knows or faces this problem? Please update your suggestions.
You need to escape:
And then read the value using text() to get the unescaped value:
alert($(".test").text()); // outputs: ×
You need to escape the ampersand:
× means a multiplication sign. (Technically it should be
× but lenient browsers let you omit the
I suspect you did not know that there are different
& escapes in HTML. The W3C you can see the codes.
× in HTML code. Use
× stands for
× in html.
&times to get ×
× code instead of
Because JSF don’t understand the
This link provides some additional information about the topic.