You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Insert content, specified by the parameter, to the end of each element in the set of matched elements.
176
179
```js
177
180
append(html) {
178
181
this.each((el) => {
@@ -187,6 +190,7 @@ append(html) {
187
190
```
188
191
189
192
##### attr
193
+
Get the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element.
190
194
191
195
```js
192
196
attr(name, value) {
@@ -204,15 +208,15 @@ attr(name, value) {
204
208
```
205
209
206
210
##### children
207
-
211
+
Get the children of each element in the set of matched elements, optionally filtered by a selector.
208
212
```js
209
213
children() {
210
214
returnnewUtils(this.element.children);
211
215
}
212
216
```
213
217
214
218
##### closest
215
-
219
+
For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
216
220
```js
217
221
closest(selector) {
218
222
if (!this.element) {
@@ -235,7 +239,7 @@ closest(selector) {
235
239
```
236
240
237
241
##### css
238
-
242
+
Get the computed style properties for the first element in the set of matched elements.
239
243
```js
240
244
css(css, value) {
241
245
if (value !==undefined) {
@@ -261,15 +265,15 @@ css(css, value) {
261
265
```
262
266
263
267
##### data
264
-
268
+
Store arbitrary data associated with the matched elements.
265
269
```js
266
270
data(name, value) {
267
271
returnthis.attr(`data-${name}`, value);
268
272
}
269
273
```
270
274
271
275
##### each
272
-
276
+
Iterate over a jQuery object, executing a function for each matched element.
273
277
```js
274
278
each(func) {
275
279
if (!this.elements) {
@@ -287,7 +291,7 @@ each(func) {
287
291
```
288
292
289
293
##### empty
290
-
294
+
Remove all child nodes of the set of matched elements from the DOM.
291
295
```js
292
296
empty() {
293
297
this.each((el) => {
@@ -298,23 +302,23 @@ empty() {
298
302
```
299
303
300
304
##### eq
301
-
305
+
Reduce the set of matched elements to the one at the specified index.
302
306
```js
303
307
eq(index) {
304
308
returnnewUtils(this.elements[index]);
305
309
}
306
310
```
307
311
308
312
##### find
309
-
313
+
Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
Reduce the set of matched elements to the first in the set.
318
322
```js
319
323
first() {
320
324
if (this.elements&&this.elements.length!==undefined) {
@@ -325,15 +329,15 @@ first() {
325
329
```
326
330
327
331
##### get
328
-
332
+
Load data from the server using a HTTP GET request.
329
333
```js
330
334
get() {
331
335
returnthis.elements;
332
336
}
333
337
```
334
338
335
339
##### hasClass
336
-
340
+
Determine whether any of the matched elements are assigned the given class.
337
341
```js
338
342
hasClass(className) {
339
343
if (!this.element) {
@@ -344,7 +348,7 @@ hasClass(className) {
344
348
```
345
349
346
350
##### height
347
-
351
+
Get the current computed height for the first element in the set of matched elements.
348
352
```js
349
353
height() {
350
354
if (!this.element) {
@@ -356,7 +360,7 @@ height() {
356
360
```
357
361
358
362
##### html
359
-
363
+
Get the HTML contents of the first element in the set of matched elements.
360
364
```js
361
365
html(html) {
362
366
if (html ===undefined) {
@@ -374,6 +378,7 @@ html(html) {
374
378
375
379
##### index
376
380
381
+
Search for a given element from among the matched elements.
377
382
```js
378
383
index() {
379
384
if (!this.element) return-1;
@@ -386,7 +391,7 @@ index() {
386
391
```
387
392
388
393
##### is
389
-
394
+
Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
390
395
```js
391
396
is(el) {
392
397
if (typeof el ==='string') {
@@ -404,7 +409,7 @@ is(el) {
404
409
```
405
410
406
411
##### next
407
-
412
+
Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
408
413
```js
409
414
next() {
410
415
if (!this.element) {
@@ -415,7 +420,7 @@ next() {
415
420
```
416
421
417
422
##### nextAll
418
-
423
+
Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
419
424
```js
420
425
nextAll(filter) {
421
426
if (!this.element) {
@@ -438,7 +443,7 @@ nextAll(filter) {
438
443
```
439
444
440
445
##### off
441
-
446
+
Remove an event handler.
442
447
```js
443
448
off(event) {
444
449
if (!this.elements) {
@@ -462,7 +467,7 @@ off(event) {
462
467
```
463
468
464
469
##### offset
465
-
470
+
Get the current coordinates of the first element in the set of matched elements, relative to the document.
466
471
```js
467
472
offset() {
468
473
if (!this.element) {
@@ -486,7 +491,7 @@ offset() {
486
491
```
487
492
488
493
##### offsetParent
489
-
494
+
Get the closest ancestor element that is positioned.
490
495
```js
491
496
offsetParent() {
492
497
if (!this.element) {
@@ -497,7 +502,7 @@ offsetParent() {
497
502
```
498
503
499
504
##### on
500
-
505
+
Attach an event handler function for one or more events to the selected elements.
501
506
```js
502
507
on(events, listener) {
503
508
if (!this.elements) {
@@ -518,7 +523,7 @@ on(events, listener) {
518
523
```
519
524
520
525
##### one
521
-
526
+
Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
522
527
```js
523
528
one(event, listener) {
524
529
this.each((el) => {
@@ -532,7 +537,7 @@ one(event, listener) {
532
537
```
533
538
534
539
##### outerHeight
535
-
540
+
Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements.
536
541
```js
537
542
outerHeight(margin) {
538
543
if (!this.element) {
@@ -552,7 +557,7 @@ outerHeight(margin) {
552
557
```
553
558
554
559
##### outerWidth
555
-
560
+
Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements.
556
561
```js
557
562
outerWidth(margin) {
558
563
if (!this.element) {
@@ -573,14 +578,15 @@ outerWidth(margin) {
573
578
574
579
##### parent
575
580
581
+
Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
576
582
```js
577
583
parent() {
578
584
returnnewUtils(this.element.parentElement);
579
585
}
580
586
```
581
587
582
588
##### parentsUntil
583
-
589
+
Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
612
618
```js
613
619
position() {
614
620
return {
@@ -619,7 +625,7 @@ position() {
619
625
```
620
626
621
627
##### prepend
622
-
628
+
Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
623
629
```js
624
630
prepend(html) {
625
631
this.each((el) => {
@@ -634,7 +640,7 @@ prepend(html) {
634
640
```
635
641
636
642
##### prev
637
-
643
+
Get the immediately preceding sibling of each element in the set of matched elements. If a selector is provided, it retrieves the previous sibling only if it matches that selector.
638
644
```js
639
645
prev() {
640
646
if (!this.element) {
@@ -645,7 +651,7 @@ prev() {
645
651
```
646
652
647
653
##### prevAll
648
-
654
+
Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector, in the reverse document order.
649
655
```js
650
656
prevAll(filter) {
651
657
if (!this.element) {
@@ -663,7 +669,7 @@ prevAll(filter) {
663
669
```
664
670
665
671
##### remove
666
-
672
+
Remove the set of matched elements from the DOM.
667
673
```js
668
674
remove() {
669
675
this.each((el) => {
@@ -675,6 +681,7 @@ remove() {
675
681
676
682
##### removeAttr
677
683
684
+
Remove an attribute from each element in the set of matched elements.
678
685
```js
679
686
removeAttr(attributes) {
680
687
constattrs=attributes.split('');
@@ -686,7 +693,7 @@ removeAttr(attributes) {
686
693
```
687
694
688
695
##### removeClass
689
-
696
+
Remove a single class or multiple classes from each element in the set of matched elements.
690
697
```js
691
698
removeClass(classNames) {
692
699
this.each((el) => {
@@ -700,7 +707,7 @@ removeClass(classNames) {
700
707
```
701
708
702
709
##### siblings
703
-
710
+
Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
704
711
```js
705
712
siblings() {
706
713
if (!this.element) {
@@ -715,7 +722,7 @@ siblings() {
715
722
```
716
723
717
724
##### text
718
-
725
+
Get the combined text contents of each element in the set of matched elements, including their descendants.
719
726
```js
720
727
text(text) {
721
728
if (text ===undefined) {
@@ -732,7 +739,7 @@ text(text) {
732
739
```
733
740
734
741
##### toggleClass
735
-
742
+
Add or remove one or more classes from each element in the set of matched elements, depending on either the class’s presence or the value of the state argument.
736
743
```js
737
744
toggleClass(className) {
738
745
if (!this.element) {
@@ -743,7 +750,7 @@ toggleClass(className) {
743
750
```
744
751
745
752
##### trigger
746
-
753
+
Execute all handlers and behaviors attached to the matched elements for the given event type.
747
754
```js
748
755
trigger(event, detail) {
749
756
if (!this.element) {
@@ -769,7 +776,7 @@ trigger(event, detail) {
769
776
```
770
777
771
778
##### unwrap
772
-
779
+
Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
773
780
```js
774
781
unwrap() {
775
782
this.each((el) => {
@@ -785,7 +792,7 @@ unwrap() {
785
792
```
786
793
787
794
##### val
788
-
795
+
Get the current value of the first element in the set of matched elements.
789
796
```js
790
797
val(value) {
791
798
if (!this.element) {
@@ -799,7 +806,7 @@ val(value) {
799
806
```
800
807
801
808
##### width
802
-
809
+
Get the current computed width for the first element in the set of matched elements.
803
810
```js
804
811
width() {
805
812
if (!this.element) {
@@ -811,7 +818,7 @@ width() {
811
818
```
812
819
813
820
##### wrap
814
-
821
+
Wrap an HTML structure around each element in the set of matched elements.
0 commit comments