Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery - equivalent to Prototype.js' "match" function

I'm upgrading an app from prototype.js to jquery.

I've got this code (prototype.js):

var el = ... /* this is done */
if (el.match('.pagination a') && el.href) {
  doAjaxStuff()
}

What is the equivalent to Element.match in jquery?

like image 896
kikito Avatar asked Dec 05 '25 09:12

kikito


1 Answers

It is the is function.

el.is('.pagination a')
like image 111
Daniel A. White Avatar answered Dec 07 '25 21:12

Daniel A. White



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!