Mention what is the disadvantage of using innerhtml in javascript?



Mention what is the disadvantage of using innerhtml in javascript?..

Answer / Avneesh Kumar

The main disadvantage of using innerHTML in JavaScript is that it may create security vulnerabilities, like cross-site scripting (XSS) attacks. Additionally, it can affect performance when dealing with large amounts of data because the entire HTML structure needs to be reconstructed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

What is string in javascript?

1 Answers  


How do you check if an object is an array or not?

1 Answers  


What is the difference between innerHTML and innerText?

1 Answers  


What does triple dot mean?

1 Answers  


Can you assign an anonymous function to a variable?

1 Answers  


Define a named function in javascript.

1 Answers  


What is node ecosystem?

1 Answers  


Explain javascript closures by example.

1 Answers  


Why is var better than let?

1 Answers  


What output will this program produce System.out.println(x+"+"+y+"="+(x+));

1 Answers  


What is Number object in JavaScript?

1 Answers  


What are javascript closures?when would you use them?

1 Answers  


Categories