• The innerHTML is an extremely popular property of every element of the Document Object Model (DOM) and used in Javascript to manipulate a website being displayed. It sets or returns the HTML content (inner HTML) of an element node.

    Each HTML element has an innerHTML property that defines both the HTML code and the tells you what combination of text and elements is between the element's opening and closing tag.

    The innerHTML property helps to write the dynamic HTML on the HTML document and you can make much more interactive pages. It also returns if any changes have been made since the page was loaded.

    There is a danger of cross-site scripting (XSS) when using this property. Software testing companies must be aware of script-injection attacks. The idea behind an XSS attack with innerHTML is that malicious code is injected into your site and can be used by malicious users to control and display undesirable elements within other HTML element tags. It can lead to loss, leak, and change of sensitive information.

    The use of inner HTML is very slow and does not provide validation which may break the document of JavaScript. The event handlers do not get attached to the new elements created by setting innerHTML automatically and had to attach it manually. This may cause a memory leak on some browsers.


    Either you add, append, delete or modify contents on a webpage using innerHTML, all contents are replaced, also all the DOM nodes inside that element are reparsed and recreated.

    The Best Software Testing Services Company - QASource
    Partner with the leading software testing company - QASource, and accomplish all your software testing services goals within strict deadlines and bud…
This reply was deleted.
    results->result as $result) { ?>
  1. jobtitle;?>
    company;?>(formattedRelativeTime;?>)city;?>, state;?>
    Welcome to Mobile QA Zone, a Next Generation Software Testing Community.Invite your friends to join this community.Write to us to become a featured member.