Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap
Do not use innerHTML. This video shows 2 HUGE reasons why you should avoid innerHTML and use alternatives instead. Learn Javascript Optimization Tips for creating dynamic content.
Subscribe https://bit.ly/3nGHmNn
This tutorial is part of an Advanced Javascript Concepts tutorial series playlist:
https://www.youtube.com/playlist?list=PL0Zuz27SZ-6N3bG4YZhkrCL3ZmDcLTuGd
DO NOT use innerHTML - 2 BIG Reasons Why | Javascript Optimization Tips
(00:00) Intro
(00:05) Welcome
(00:16) Setup
(01:13) Reason #1 to stop using innerHTML
(02:17) A better solution
(04:50) Reason #2 to stop using innerHTML
(06:37) If you must use innerHTML, do this first!
Referenced Tutorials:
10 Time-Saving Javascript Functions: https://youtu.be/LDgPTw6tePk
References:
MDN innerHTML: https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML
MDN createElement: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
MDN createDocumentFragment: https://developer.mozilla.org/en-US/docs/Web/API/Document/createDocumentFragment
Follow Me:
Twitter: https://twitter.com/yesdavidgray
LinkedIn: https://www.linkedin.com/in/davidagray/
Blog: https://yesdavidgray.com
Reddit: https://www.reddit.com/user/DaveOnEleven
Was this tutorial about why you should stop using innerHTML in Javascript helpful? If so, please share. Let me know your thoughts in the comments.
#innerHTML #javascript #optimization