1
00:00:00,270 --> 00:00:01,130
Welcome back.

2
00:00:01,140 --> 00:00:07,620
In this lesson, we're going to finalise our content and we want to add in the ability to select all.

3
00:00:07,620 --> 00:00:13,890
So whenever we click on here, we want basically all of that content to be selected automatically.

4
00:00:14,260 --> 00:00:15,780
So let's add that in.

5
00:00:15,840 --> 00:00:18,290
And we could add that in by a click event.

6
00:00:18,630 --> 00:00:25,230
So selecting that final text object, let's add an event listener and this event listener is going to

7
00:00:25,230 --> 00:00:31,070
be listening for a click and we'll just do a select all function and we create that function right now.

8
00:00:31,560 --> 00:00:33,690
So a function and we call it select.

9
00:00:33,690 --> 00:00:41,190
All we want to do is select all of the contents of that element that's invoking this that's triggering

10
00:00:41,190 --> 00:00:41,800
this event.

11
00:00:42,210 --> 00:00:48,590
So this is going to be really easy to do where we're just selecting this object and applying select.

12
00:00:48,600 --> 00:00:54,750
So just as we saw when we were copying it to the clipboard, whenever we've got an active area, an

13
00:00:54,750 --> 00:01:02,310
element, an input or a text area, we can do a select all on that by running a function, a method

14
00:01:02,310 --> 00:01:03,870
in JavaScript called select.

15
00:01:04,110 --> 00:01:09,780
So what this is going to do is this is simply going to select all of the contents there and make it

16
00:01:09,780 --> 00:01:10,640
all highlight.

17
00:01:10,860 --> 00:01:11,810
So let's try that it.

18
00:01:12,000 --> 00:01:15,590
So now whenever I click on here, it's going to select all of that content.

19
00:01:15,600 --> 00:01:20,910
And this should actually not only be on final text, we should also put it on the copy text as well

20
00:01:21,360 --> 00:01:23,190
and added into copy text.

21
00:01:23,370 --> 00:01:27,510
And that's the nice thing about having these functions, because you can reuse them wherever you need

22
00:01:27,510 --> 00:01:28,120
to have them.

23
00:01:28,380 --> 00:01:30,210
So I've got it within there.

24
00:01:30,540 --> 00:01:35,870
And whenever I move the text, whenever I click on this section, I've got that highlighting as well.

25
00:01:36,030 --> 00:01:41,370
So we can highlight any one of these text areas now simply by clicking on them and highlight all of

26
00:01:41,370 --> 00:01:42,300
the content contained.

27
00:01:42,600 --> 00:01:48,000
So now that you've got your application working as intended and one of the most important things, again,

28
00:01:48,000 --> 00:01:53,540
was to get more familiar with the executing command and specifically copy copying it to the clipboard.

29
00:01:53,790 --> 00:01:57,570
So go ahead and try that out for yourself and get familiar with it.

30
00:01:57,570 --> 00:02:03,450
And also add in the ability to select text areas when all of the content within the text is when you

31
00:02:03,450 --> 00:02:03,990
click on it.

32
00:02:04,420 --> 00:02:06,480
And coming up next, we'll do a final code review.
