Skip to content

Commit afaeef3

Browse files
danheberdenajpiano
authored andcommitted
Fix html tag formatting in selecting-elements
1 parent dccf7b2 commit afaeef3

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

content/jquery-fundamentals/jquery-basics/selecting-elements.md

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
2-
chapter : jquery-basics
3-
section : 2
4-
title : Selecting Elements
5-
attribution: jQuery Fundamentals
2+
chapter : "js101"
3+
section: "2"
4+
title: "Operators"
65
---
7-
## Selecting Elements
6+
## Basic Operators
87
Selecting Elements
9-
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
108

119
The most basic concept of jQuery is to “select some elements and do something with them.”
1210
jQuery supports most CSS3 selectors, as well as some non-standard selectors.
@@ -53,11 +51,7 @@ Pseudo-selectors
5351
When you use the :visible and :hidden pseudo-selectors, jQuery tests the actual
5452
visibility of the element, not its CSS visibility or display — that is, it looks
5553
to see if the element's physical height and width on the page are both greater than zero.
56-
<<<<<<< HEAD
5754
However, this test doesn't work with &lt;tr> elements; in this case, jQuery does check
58-
=======
59-
However, this test doesn't work with <tr> elements; in this case, jQuery does check
60-
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
6155
the CSS display property, and considers an element hidden if its display property
6256
is set to none. Elements that have not been added to the DOM will always be
6357
considered hidden, even if the CSS that would affect them would render them
@@ -72,33 +66,21 @@ For reference, here is the code jQuery uses to determine whether an element is v
7266
skip = elem.nodeName.toLowerCase() === "tr";
7367

7468
// does the element have 0 height, 0 width,
75-
<<<<<<< HEAD
7669
// and it's not a &lt;tr>?
77-
=======
78-
// and it's not a <tr>?
79-
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
8070
return width === 0 && height === 0 && !skip ?
8171

8272
// then it must be hidden
8373
true :
8474

8575
// but if it has width and height
86-
<<<<<<< HEAD
8776
// and it's not a &lt;tr>
88-
=======
89-
// and it's not a <tr>
90-
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
9177
width > 0 && height > 0 && !skip ?
9278

9379
// then it must be visible
9480
false :
9581

9682
// if we get here, the element has width
97-
<<<<<<< HEAD
9883
// and height, but it's also a &lt;tr>,
99-
=======
100-
// and height, but it's also a <tr>,
101-
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
10284
// so check its display property to
10385
// decide whether it's hidden
10486
jQuery.curCSS(elem, "display") === "none";
@@ -123,11 +105,7 @@ jQuery offers many attribute-based selectors, allowing you to make selections
123105
based on the content of arbitrary attributes using simplified regular expressions.
124106

125107
<div class="example" markdown="1">
126-
<<<<<<< HEAD
127108
// find all &lt;a>s whose rel attribute
128-
=======
129-
// find all <a>s whose rel attribute
130-
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
131109
// ends with "thinger"
132110
$("a[rel$='thinger']");
133111
</div>
@@ -202,11 +180,7 @@ Sometimes you have a selection that contains more than what you're after; in thi
202180
<div class="example" markdown="1">
203181
Refining selections
204182

205-
<<<<<<< HEAD
206183
$('div.foo').has('p'); // div.foo elements that contain &lt;p>'s
207-
=======
208-
$('div.foo').has('p'); // div.foo elements that contain <p>'s
209-
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
210184
$('h1').not('.bar'); // h1 elements that don't have a class of bar
211185
$('ul li').filter('.current'); // unordered list items with class of current
212186
$('ul li').first(); // just the first unordered list item
@@ -265,4 +239,4 @@ Selects inputs with type="text"
265239
Using form-related pseduo-selectors
266240

267241
$('#myForm :input'); // get all elements that accept input
268-
</div>
242+
</div>

0 commit comments

Comments
 (0)