WEBVTT 00:00:06.680 --> 00:00:13.310 In this video we're going to learn how to use javascript to change a shemale content. 00:00:13.710 --> 00:00:20.280 First of all this creates a new file and codes change ASML content. 00:00:23.880 --> 00:00:32.160 And we're going to enforce the content from a file you know says chapter and he's going to be the divin 00:00:32.160 --> 00:00:35.710 spend file. 00:00:38.030 --> 00:00:38.300 Ok 00:00:43.190 --> 00:00:47.400 I just need a title to change human content 00:00:53.010 --> 00:00:55.770 and refresh all life. 00:00:57.540 --> 00:00:59.350 So are we trying to achieve here. 00:00:59.460 --> 00:01:06.930 So we want to create a button and when we click on the button we want the Facebook Divx content to change 00:01:06.930 --> 00:01:08.250 . 00:01:08.250 --> 00:01:13.140 So let's go ahead and read this puzzle first following the Microsoft Steve 00:01:17.840 --> 00:01:25.800 let's put some text to change Facebook content and let's give you an idea because we're going to be 00:01:25.800 --> 00:01:31.100 referring to it in the code using the elements by id method. 00:01:32.040 --> 00:01:39.000 Let's give you an idea of button 1. 00:01:39.820 --> 00:01:40.210 OK. 00:01:40.230 --> 00:01:45.570 Now we are going to write our scripts. 00:01:45.780 --> 00:01:52.740 So first off we need to do we need to access the button and then say in the event of clicking on the 00:01:52.740 --> 00:01:55.790 button change the contents on the Facebook. 00:01:56.280 --> 00:02:05.110 So we're going to use the syntax documents gets elements my ID and it's going to be able to in one. 00:02:06.440 --> 00:02:17.810 And then the event is on click and the function that you want to execute is the following. 00:02:18.570 --> 00:02:24.690 So we want to access the Facebook Dave using the ID so documents gets elements my ID. 00:02:25.290 --> 00:02:32.170 OK so we see here that Facebook doesn't have an I.D. yet so it is creating I.D. for it and it's Facebook 00:02:33.480 --> 00:02:33.800 OK 00:02:39.480 --> 00:02:47.520 now to change the content of the ASML elements we need to use e-mail. 00:02:49.020 --> 00:02:56.190 So basically in a bill if we change DNA Shamal that means that we are changing the whole contents of 00:02:56.190 --> 00:03:00.210 the elements. 00:03:00.390 --> 00:03:10.410 So what's going to happen here is anything inside the div tags of Facebook is going to be changed and 00:03:10.410 --> 00:03:16.090 replaced by ever a symbol code we can arise between those two quotes. 00:03:16.120 --> 00:03:19.170 OK so let's try a paragraph for instance 00:03:23.270 --> 00:03:25.160 and put some text there. 00:03:25.680 --> 00:03:26.700 Facebook. 00:03:27.610 --> 00:03:28.320 Let's see what happens. 00:03:28.320 --> 00:03:32.650 So again what we put in here is a code. 00:03:32.790 --> 00:03:35.660 So it's not necessarily text only. 00:03:35.780 --> 00:03:37.080 OK it could be a paragraph. 00:03:37.080 --> 00:03:39.520 It could be a list could be anything. 00:03:39.960 --> 00:03:43.380 All right so let's refresh the page and click on the button. 00:03:43.500 --> 00:03:44.540 So it is working. 00:03:44.700 --> 00:03:53.320 So now everything inside the dog tags of Facebook has just changed to this new paragraph. 00:03:53.390 --> 00:03:56.800 They destroy something else with the Apple dev. 00:03:56.880 --> 00:04:01.380 So this creates a new pattern. 00:04:04.500 --> 00:04:05.660 OK. 00:04:06.000 --> 00:04:10.680 Let's get some text. 00:04:12.990 --> 00:04:14.070 And let's give you an ID 00:04:17.670 --> 00:04:18.910 button too. 00:04:19.590 --> 00:04:21.020 OK. 00:04:21.030 --> 00:04:26.820 So we're going to be accessing the apple later on using the elements by ID when we need to give us an 00:04:26.820 --> 00:04:28.480 idea as well. 00:04:29.580 --> 00:04:34.500 So now when its rights and other statements. 00:04:34.710 --> 00:04:37.080 OK so documents 00:04:39.810 --> 00:04:43.410 gets elements my ID so we want to access the second button 00:04:47.320 --> 00:04:49.950 and the event is on click 00:04:52.910 --> 00:04:59.990 OK you can try on DoubleClick as well if you want to. 00:05:00.280 --> 00:05:08.910 And now we are going to be executing the following function which is going to be accessing the apple 00:05:08.910 --> 00:05:09.640 dev. 00:05:09.660 --> 00:05:18.660 So since exit documents say that it is my ID and you want the ID of Apple and we are using the in a 00:05:18.740 --> 00:05:22.290 a similar again to to the content. 00:05:22.290 --> 00:05:24.270 So at this time we're going to try something different. 00:05:24.270 --> 00:05:26.610 We're going to try a and an ordered list. 00:05:26.730 --> 00:05:27.150 So let's 00:05:29.850 --> 00:05:30.600 build a list 00:05:36.160 --> 00:05:37.200 of some items 00:05:41.470 --> 00:05:43.970 gets 00:05:46.350 --> 00:05:48.490 some comics the 00:05:51.700 --> 00:05:51.900 beer 00:05:54.860 --> 00:05:55.750 Macy's 00:06:00.900 --> 00:06:04.500 refresh the page and Troy the button. 00:06:04.560 --> 00:06:09.480 So if we click once it doesn't work because we have the on double clicks we're going to click twice 00:06:09.990 --> 00:06:11.200 and now it is working. 00:06:11.310 --> 00:06:17.720 You can see the content has just changed to the last and also the Facebook button is also working. 00:06:17.730 --> 00:06:24.140 So we have learned now how to use javascript to change the email content is pretty easy. 00:06:24.300 --> 00:06:30.030 We just need to make sure that we use the get elements by the method in the proper way choose the right 00:06:30.120 --> 00:06:30.770 events. 00:06:30.870 --> 00:06:31.700 OK. 00:06:32.280 --> 00:06:39.940 And then also Barry might again that's the end of a shemale is not necessarily text. 00:06:39.960 --> 00:06:45.430 So we basically put any Esquibel code between our two quotes. 00:06:45.480 --> 00:06:46.240 All right. 00:06:46.490 --> 00:06:51.210 In the next video we're going to learn how to use javascript to change a shameful styling