There are several ways to read an HTML element with JavaScript, depending on what you want. We identify the differences between innerHTML, innerText, textContent, and value. Then read a value from an input element.
Lesson Links
Find the full course playlist here: • Gentle Introduction to JavaScript
"Element.innerHTML" on MDN: https://developer.mozilla.org/en-US/d...
"HTMLElement.innerText" on MDN: https://developer.mozilla.org/en-US/d...
"Node.textContent" on MDN: https://developer.mozilla.org/en-US/d...
"HTMLInputElement" on MDN: https://developer.mozilla.org/en-US/d...
Code for this course: https://github.com/DeborahK/Gentle-In...
Content
00:00 Reading an HTML element with JavaScript
00:38 innerHTML
00:54 innerText
01:13 textContent
01:27 value
01:44 Coding Along: Reading an HTML element
04:54 Demo: Finding the input element
05:40 Demo: Reading the value from an input element
06:33 Key points
Audience
• Anyone new to JavaScript.
• Existing developers that use JavaScript, and want to understand more about its syntax and how to use it on the web.
• Students considering a programming or web development career.
• Creatives that want a give their web pages some interactivity.
• Those that manage or interact with web developers to better understand what JavaScript is and how it is used.
This is the sixth and final course of the "How to Become a Web Developer" series.
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
😊About Me
Hey! I'm Deborah Kurata
I'm a software developer and YouTube content creator. I speak at conferences such as VS Live and ng-conf. I write articles for freeCodeCamp. And I'm a Pluralsight author with courses in the top 10 most popular (out of 10,000+) over the past 5 years. For my work in support of software developers, I've been recognized with the Microsoft Most Valuable Professional (MVP) award, and I'm a Google Developer Expert (GDE).
View my YouTube content: / @deborah_kurata
Contact me on Twitter: / deborahkurata
Find my Pluralsight courses: https://www.pluralsight.com/profile/a...
Access my freeCodeCamp articles: https://www.freecodecamp.org/news/aut...
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#getelementbyid #getelementbyidjavascript #innerhtmljavascript #innertextjavascript #textcontentjavascript #valuejavascript #javascript #javascripttutorial #javascriptcourse #javascriptprojects #javascriptproject #introductiontojavascript #learnjavascript #javascriptinthebrowser #kurata #beginners #code #learntocode #gettingstarted #programming #programmingbasics #programmer #learnprogramming #learnprogrammingonyoutube #development #developer