Hello, in this jQuery video, I am going to show you how to get and set the text of an element. So the text of an element is the you know, piece of text that goes between the two element tags. So the opening and closing for this day is awesome. So first of all, let's just select it. All you got this button click setup right here. dollar example dot txt.
And if you don't pass in anything, what it does is just return the value. So I'm going to do console dot log and you could actually just sign this to a variable using later on and use it in a console log boms going to go straight to the console log or click it get I am awesome. If however, I want to modify it, it is really simple. It is almost Same. The only difference is you actually specifying a value in here. So if I say awesome stuff, go to elements.
No, I think he says I am awesome. I click it. Now chain two awesome stuff. So this is how you get a text value. This is how you change a text value. This is just a function parameter.
So you could pass in a normal variable that you've maybe retrieved or computed into this text function. So that's it for this video. If you have any questions, feel free to drop me a message. And as usual, I look forward to seeing you in the next video.