Welcome back.
In this lesson, we're going to finalise our content and we want to add in the ability to select all.
So whenever we click on here, we want basically all of that content to be selected automatically.
So let's add that in.
And we could add that in by a click event.
So selecting that final text object, let's add an event listener and this event listener is going to
be listening for a click and we'll just do a select all function and we create that function right now.
So a function and we call it select.
All we want to do is select all of the contents of that element that's invoking this that's triggering
this event.
So this is going to be really easy to do where we're just selecting this object and applying select.
So just as we saw when we were copying it to the clipboard, whenever we've got an active area, an
element, an input or a text area, we can do a select all on that by running a function, a method
in JavaScript called select.
So what this is going to do is this is simply going to select all of the contents there and make it
all highlight.
So let's try that it.
So now whenever I click on here, it's going to select all of that content.
And this should actually not only be on final text, we should also put it on the copy text as well
and added into copy text.
And that's the nice thing about having these functions, because you can reuse them wherever you need
to have them.
So I've got it within there.
And whenever I move the text, whenever I click on this section, I've got that highlighting as well.
So we can highlight any one of these text areas now simply by clicking on them and highlight all of
the content contained.
So now that you've got your application working as intended and one of the most important things, again,
was to get more familiar with the executing command and specifically copy copying it to the clipboard.
So go ahead and try that out for yourself and get familiar with it.
And also add in the ability to select text areas when all of the content within the text is when you
click on it.
And coming up next, we'll do a final code review.