Mention what is the disadvantage of using innerHTML in JavaScript?
Submitted by: AdministratorIf you use innerHTML in JavaScript the disadvantage is
► Content is replaced everywhere
► We cannot use like "appending to innerHTML"
► Even if you use +=like "innerHTML = innerHTML + 'html'" still the old content is replaced by html
► The entire innerHTML content is re-parsed and build into elements, therefore its much slower
► The innerHTML does not provide validation and therefore we can potentially insert valid and broken HTML in the document and break it
Submitted by:
► Content is replaced everywhere
► We cannot use like "appending to innerHTML"
► Even if you use +=like "innerHTML = innerHTML + 'html'" still the old content is replaced by html
► The entire innerHTML content is re-parsed and build into elements, therefore its much slower
► The innerHTML does not provide validation and therefore we can potentially insert valid and broken HTML in the document and break it
Submitted by:
Read Online Expert Developer JavaScript Job Interview Questions And Answers
Top Expert Developer JavaScript Questions
☺ | Mention what is the disadvantage of using innerHTML in JavaScript? |
☺ | Which keyword is used to print the text in the screen? |
☺ | Why it is not advised to use innerHTML in JavaScript? |
☺ | Explain the concept of unobtrusive JavaScript? |
☺ | How are JavaScript and ECMA Script related? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |