From the course: jQuery for Web Designers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Read and set values

Read and set values - jQuery Tutorial

From the course: jQuery for Web Designers

Start my 1-month free trial

Read and set values

- [Voiceover] In this video we're going to take a look at some of the methods that jQuery gives you for getting value out of a particular part of the page, and then setting that value if you want to do that. So I'm going to start out in the JavaScript console. I'm going to inspect this element here by right clicking and choosing inspect. I can see that this is an H1 inside the header tag. So over here inside the JavaScript console I'm going to select that header, there it is. And now if I use a method called HTML and pass in no arguments, I get just the HTML that comprises that element. As you can see this includes white space, depending on the browser you're using you may see more or less of this. So this is the HTML, but what if I wanted to see the text that actually makes up this element? I'll try that again, only instead of using HTML, I'm going to use text. There we go. Welcome to Explore California. And once again we have a bunch of white space here. There's another method…

Contents