From JavaScript to React Flashcards
The DOM is an ……………………. representation of the HTML elements.
object
It acts as a bridge between your code and the …………………., and has a ………………………… structure with parent and child relationships.
user interface, tree-like
You can use DOM ……………………. and a …………………………………….., such as JavaScript, to listen to user events and manipulate the DOM by ….(1),….(2)….(3)……(4)…. specific elements in the user interface.
methods, programming language, (1)selecting, (2)adding, (3)updating, and (4)deleting
DOM manipulation allows you to not only target specific elements, but also change their……………. and …………..
style, content
The DOM of the page is different from the ……..(1)…………. - or in other words, the original HTML file you created. This is because the HTML represents the …..(2)…… page content, whereas the DOM represents the …..(3)……….. page content which was changed by the JavaScript code.
source code, initial, updated
Specify the appropriate method :
1.A method that retrieves an HTML element from the document using its unique identifier (ID).
2.A method that creates a new text node in the document.
3.A method that creates a new HTML element in the document.
4.A method that appends a child element to a parent element in the document’s DOM tree.
1.getElementById()
2.createTextNode()
3.createElement()
4.appendChild()
react is the …………… React library. react-dom provides………………methods that enable you to use React with the DOM.
core, DOM-specific
JSX is a ………………………….. for JavaScript that allows you to describe your UI in a familiar HTML-like syntax. Note that browsers don’t understand JSX out of the box, so you’ll need a JavaScript compiler, such as a …………………………., to transform your JSX code into regular JavaScript.
syntax extension, Babel