QUIZGUM

Coding Class

Quizgum : find

find()

find has the ability to select a tag within a certain tag.
It's hard to say, so let's look at the sauce and understand.

HTML

<div class="hello">
	<p>php</p>
	<b>html5</b>
	<h4>css3</h4>
</div>

In the source above, php html5 css3 is wrapped in a different tag in hello.
Let's select the h4 class using find().
Then we'll just hit the red outline of the h4 class in hello.

jQuery

    var hello = $('.hello');
    var h4 = hello.find('h4');
    h4.css('border',1px solid red');

Result

php

html5

css3

In the result above, you can see that only the h4 tag css3 is processed with red outline. The locations are weird due to the influence of Aberdebel's css. Please do not mind.
Then you can use the h4 tag as a selector or why you can think of this one .. When you
practice, you get a moment that you have to use it when you do this.

Source

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>quizgum :: jQuery Course</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.0.min.js" ></script>
<script type="text/javascript">
$(function(){
    var hello = $('.hello');
    var h4 = hello.find('h4');
    h4.css('border','1px solid red');
});
</script>
<style>
</style>
</head>
<body>
<div class="hello">
<p>php</p>
<b>html5</b>
<h4>css3</h4>
</div>
</body>
</html>