Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8186927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:23:25+00:00 2026-06-07T02:23:25+00:00

I wonder how I can write the jQuery is method using only javascript? You

  • 0

I wonder how I can write the jQuery is method using only javascript?

You can’t use any third party libraries. Only the javascript provided from the browser.

FYI the method is in jQuery:

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:23:27+00:00Added an answer on June 7, 2026 at 2:23 am

    If you need support for older browsers, you should use jQuery. This should work in IE9, Firefox and Chrome.

    //returns true if element matches selector or if element is equal to the node passed as selector
    function is( elem, selector ) {
        var div = document.createElement("div");
        var matchesSelector = div.webkitMatchesSelector || div.mozMatchesSelector || div.msMatchesSelector;
        return typeof selector == "string" ? matchesSelector.call( elem, selector ) : selector === elem;
    }
    //returns true if any elements in the array/nodelist "is" selector
    function anyIs( elems, selector ) {
        var l = elems.length, i;
    
        for( i = 0; i < l; ++i ) {
            if( is( elems[i], selector ) ) {
                return true;
            }
        }
        return false;
    }
    
    is(document.createElement("div"), "div")
    //true
    is(document.createElement("div"), "li")
    //false
    anyIs(document.getElementsByTagName("div"), document.getElementsByTagName("div")[3])
    //true
    anyIs(document.getElementsByTagName("div"), "div")
    //true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if there is any way I can write to files from HTML5/JS?
I am trying to write my own Javascript Framework something like jQuery. I use
I wonder how can I download/save/write a file from my server to a client's
I wonder if in my program I have only 1 thread, can I write
I wonder about that can I write native SQL to add or delete operations
I wonder how can I search for a certain pattern in file, but only
I wonder if I can execute some programs for different cmd's using .bat file.
I'm aware that using /USER_ID/feed on a API call, you can write to this
SQL Question I wonder if I can write a single sql INSERT statement to
I read this article and i wonder. http://www.quirksmode.org/js/support.html How can we write css codes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.