+ 2

Can you guys help me the output of this code please

<p>3&minus;2</p> I need a clear discription of how the outcome is obtained please

25th Sep 2019, 5:19 AM
REI SEKO
REI SEKO - avatar
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
25th Sep 2019, 5:29 AM
Dejan Dozet
Dejan Dozet - avatar
+ 3
First they are user friendly (readable), then some have special properties like &nbsp; (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(&quot;here&quot;)", etc. That are the some that I use, but there are more for sure
25th Sep 2019, 9:03 AM
Dejan Dozet
Dejan Dozet - avatar
+ 3
&minus; means the browser will render it as - so the output will be 3-2
27th Sep 2019, 2:21 AM
Aditya
Aditya - avatar
+ 2
So what are the applications of HTML entities
25th Sep 2019, 7:03 AM
REI SEKO
REI SEKO - avatar
+ 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.
25th Sep 2019, 5:37 AM
Abdul Aleem Baig
Abdul Aleem Baig - avatar
+ 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
25th Sep 2019, 11:32 AM
Andrew Johnson
Andrew Johnson - avatar
0
Much thanks for your help
25th Sep 2019, 12:44 PM
REI SEKO
REI SEKO - avatar