disadvantages of using inner HTML in JavaScript

Home Forums Java Script disadvantages of using inner HTML in JavaScript

This topic contains 1 reply, has 2 voices, and was last updated by  Sushmita Ghosh 3 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1329

    nayak.anjali.hyd
    Participant

    What are the disadvantages of using inner HTML in JavaScript?

    #1330

    Sushmita Ghosh
    Keymaster

    The use of inner HTML in JavaScript has the following disadvantages –

     

    1. The process of using inner HTML is much slower than the rest of the variables as its content is slowly built into different elects and takes time to get re-parsed.

    2. While using the inner HTML, the content gets replaced in JavaScript.

    3. Appending to inner HTML can’t be used properly.

    4. Using inner HTML can also break the document of the JavaScript. Since no validation is required by it, any type of valid inner HTML can be used. Even broken HTML can also be used and this can cause problems.

    5. The old content also gets easily replaced.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Pasham Technology © 2018 Pasham Technologies