Is it safe to use innerHTML in JavaScript?

Опубликовано: 29 Сентябрь 2024
на канале: Code With Bubb
6,404
154

In today's JavaScript tutorial we're going to look at the innerHTML property that's available in JavaScript to dynamically update elements on the page with a string including HTML content.

Is it safe to use innerHTML in JavaScript? What could be the effects of assigning a string that has HTML content inside it?

We'll see in the video that innerHTML needs to be used with some caution although there are a few safeguards in place to ensure malicious users are kept at bay.

#javascript #webdevelopment Channel Handle @codebubb