We absolutely can! In a JavaScript file, we can use DOM methods and properties to create (or insert, update, delete, etc) HTML elements stored as strings in a JS variable (or as a string passed to a DOM method/property).
However, when using the JavaScript library React, we will normally use JSX to create HTML elements inside a JavaScript file which uses different syntax than we would use if we were using DOM methods/properties.
Thank you for that explanation. It’s pretty clear now to me, however, and example of a DOM method would make it much more evident. Could you provide one?
what is stopping you to use google to find the relevant information? Learning to find and understand the information you are looking for is a good skill to have as a developer
A very convenient answer, though as a paying member I could prefer to hear the answer from the Codecademy staff. Why wouldn’t I use Google to learn all the programming otherwise?
You could, but sites like codecademy offer more structure and order in learning things. Google is great to search for pieces of information you miss or want clarification on.
@juenel@lahinouski some DOM methods are document.getElementById(idName) and . document.querySelector(CSS selector). The JavaScript file must be linked to the HTML file by the tag.