Javascript Tutorial | Changing HTML Elements @Avelx
Javascript Tutorial | Changing HTML Elements  @Avelx
Uploaded January 2016 | Updated September 2026, 2 weeks ago
Javascript works hand in hand with the DOM as we know. So how about changing text and information within the DOM. Well we can easily do this by targeting an object that represents the DOM element in Javascript and modify the innerHTML or innerText properties.

Firstly I'll be changing the innerText property. The innerText property allows us to insert text into a DOM element that is visible to the user, if you try passing in HTML it'll escape all characters. However using the innerHTML property we can insert text and HTML as well. Now we can add child elements to the element in question.

This tutorial is brought to you by avelx.co.uk - Coding tutorials to help you grow.
Javascript Tutorial | Changing HTML ElementsJavascript Tutorial | Embedding Objects & Arrays | Ep13Generators Yielding DataTypesJavascript Tutorial |  Targeting DOM Elements | Ep31Vue Preprocessors, Styling & V html Directive | VueJS Ep08Javascript Tutorial | Code Editors & Debugging | Ep10Javascript Tutorial | Create & Append, InsertBefore & InsertAfter | Ep35Javascript Tutorial | How Does JS Work? | Ep2Spaceship operatorFunctions in SASSCMS integration on Vue, Angular or React componentsObject Oriented Encapsulation Principle
Programming With Avelx |

Javascript Tutorial | Changing HTML Elements

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER