Div1.InnerHtml = (someString);
-VS-
Div1.InnerHtml += (someString);
I notice they both do the same thing, but is there any real difference whether I have the + in there or not?
Also.. What’s the difference between InnerText & InnerHtml?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
+=will append(someString)to the existing value ofDiv1.InnerHtml, whereas=will replace the value ofDiv1.InnerHtmlwith(someString).If the results are the same then the starting value of
Div1.InnerHtmlis likelynullorstring.Empty("")Regarding
InnerTextvsInnerHtml:InnerHtmlmight return something like<h1>Hello World</h1>whereasInnerTextwould returnHello World(the value of the element without the actual HTML element).Consider these cases: