+ 2
Can you guys help me the output of this code please
<p>3−2</p> I need a clear discription of how the outcome is obtained please
7 Answers
+ 3
These are called HTML entities, they will be shown on page as certain characters like minus sign in your case, more about it:
https://www.w3schools.com/html/html_entities.asp
+ 3
First they are user friendly (readable), then some have special properties like (non breaking space) that you can use on responsive pages not to let two words to break at white space, then to HTML encode text - that you will use when write inline HTML and text in dom element's event attribute onclick="alert("here")", etc. That are the some that I use, but there are more for sure
+ 3
− means the browser will render it as -
so the output will be 3-2
+ 2
So what are the applications of HTML entities
+ 1
HTML is a structure language not a scripting language and this is a p tag (paragraph) of HTML.
In this tag, what you write, shows its as a simple text.
+ 1
Since your desired operation is with in <p> tags, which is a tag that represents a paragraph, it will output what you placed with in it. The &minus is a just a symbol that represents a negative/ subtraction sign. HTML wont work with mathematical operations unless used along side a scripting language
0
Much thanks for your help