Welcome back.
So in this video we're talking about remove HDMI content.
This is gonna be a lot of fun because this is really what the main purpose of Jake Query is is making
things dynamic and not having to write everything out.
So let's go to the HD docs shortcut on the desktop.
Let's go to learn advance Jake worry.
Let's right click to new folder.
I'm want to do 0 5.
Remove each time all content.
Ok so my close that folder out and we're going to line.
Right click do new file do index that Himmel and control end and then control acid demand Ijaz.
I'm going to go to the subject query folder when new index on each from L control c.
Control X control V that control us and control w control v the pasted in here.
And then the mandate J.S..
Copy that as well pasted here enclose these out and let's go to the remove age in our content.
And I'm going to bring this one over.
Right click open the browser let's inspect this to console.
Yep.
It's connected beautiful clothes that out and like I said this is the fun part.
So I'm trying to get past the boring stuff as quickly as possible so the remove elements is awesome.
So the first method we're going to talk about is the removed method so it removes the selected element
and it's child elements.
So in this example it's going to remove the entire element.
So we're gonna create a div so let's write out the H to Mal real quick and what we're gonna do is we're
gonna do div I.D. Div 1 and we're gonna style this kibbutz to see us as a height one 100 pixels with
three hundred pixels pop up well
there we go border is gonna be one pixel solid black and the background color is gonna be yellow.
There you go.
So in order to make a div work you have to have a width and a height and at least the border so that
way you can tell where the element is.
OK so now below this we're gonna do
we're still inside the devs so we need to close the div tag.
There we go and inside of this we'll just make an H1.
This is some text remove me.
OK so now what we're gonna do is we're going to order the main dot J File delete the console that log
we're going to document
go ready we're into a function and we're gonna do the brackets we're gonna call the button
and we're going to do dot Clark function we'll do another bracket and we're gonna return the idea of
Div 1 dot removed so we're gonna use the remove method.
So basically you call them Athens and remove this sorry closed that close this one and let's right click
open the browser and the index on a shrimp file.
This is some tax removed me.
Now I don't have the button which we.
I forgot to add that.
So let's add the button because it's really hard to remove it if I don't have a button remove div element.
OK.
Now let's try it again open in the browser.
There you go.
Remove development.
Beautiful.
There you go.
And let's make make this a little nicer why add a couple of breaks here just to clean it up a little
bit so it's easier to see the elements.
There you go.
Beautiful.
OK so that is the remove method.
Now the other method I want to talk about is the empty method.
So the jiggery empty method removes the child elements of the Select elements.
So in this example what we're going to do is we're going to add to what we just wrote.
So all I want you to do is I want you to in this document here and in the main that GM stock what we're
going to do is we're going to instead of having dot remove we're going to do dot empty.
OK.
And what I'm going to do is I'm going to copy this and paste it below and going to make this remove.
And we're going to comment this line out so that way you have both methods.
So when you come back to look at this you say well I want to how do I do the remove method that remove.
There you go.
So let's right click open in the browser and I still have removed development but when I click it it
actually empties that have element.
So we'll make another button just so we know and we'll do empty
development when a right click opens the browser and empty the development.
OK.
So that's the remove H2 all content for J.
Query.
So thank you for watching.
I'll see in the next video.