PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: Use of 'innerHTML' property

Last modified: 21 March 2023

Reports a JavaScript access to DOM nodes as text using the innerHTML property. Most usages of innerHTML are performed better with explicit DOM calls, such as getElementByID() and createElement(). Additionally, innerHTML will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can lead to difficulties in diagnosing bugs.