I am using the following code.
HTML Code :
<div class="test">×</div>
Javascript:
alert($(".test").html());
I am getting ×
in alert. I need to get ×
as result.
Anybody knows or faces this problem? Please update your suggestions.
This question is related to
javascript
jquery
html
×
stands for ×
in html.
Use &times
to get ×
I suspect you did not know that there are different &
escapes in HTML. The W3C you can see the codes. ×
means ×
in HTML code. Use &times
instead.
Use the ×
code instead of ×
Because JSF don't understand the ×
code.
Use: ×
with ;
This link provides some additional information about the topic.
You need to escape the ampersand:
<div class="test">&times</div>
×
means a multiplication sign. (Technically it should be ×
but lenient browsers let you omit the ;
.)
Source: Stackoverflow.com