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

  • SEARCH
  • Home
  • 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 7002801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:58:33+00:00 2026-05-27T20:58:33+00:00

I know I can select elements using the following syntax, but what other ways

  • 0

I know I can select elements using the following syntax, but what other ways are available? I didn’t know what to search for when trying to determine others. Also, are there ways to select elements via wildcard characters?

  //Selection by the element's ID
  $('#mybutton').on('click', function (e) {
     alert('mybutton clicked');
  });

  //Select by the element's css class
  $('.mybuttonclass').on('click', function (e) {
     alert('mybutton clicked');
  });

  //Selection of a tag with name of delete found within a table
  $('table').on('click','a[name=delete]', function (e) {
     alert('table link clicked');
  });

So, I can use name, ID or class. Are there other ways? A google search term or a link would be helpful.

EDIT:

I had found the selectors page in the documentation, but didn’t think this page applied. I had trouble making sense of the page, and thought that it was referring to something else. That’s why I was looking for another search term, because everything was bringing up ‘Selectors’, and I didn’t think that’s what I was needing. apparently I was in the right place after all.

  • 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-05-27T20:58:34+00:00Added an answer on May 27, 2026 at 8:58 pm
        Selector    Example       Selects
        *           $("*")                All elements
        #id         $("#lastname")  The element with id=lastname
        .class  $(".intro") All elements with class="intro"
        element $("p")  All p elements
       .class.class $(".intro.demo")    All elements with the classes "intro" and "demo"
    
        :first  $("p:first")    The first p element
        :last   $("p:last") The last p element
        :even   $("tr:even")    All even tr elements
        :odd    $("tr:odd") All odd tr elements
    
        :eq(index)  $("ul li:eq(3)")    The fourth element in a list (index starts at 0)
        :gt(no) $("ul li:gt(3)")    List elements with an index greater than 3
        :lt(no) $("ul li:lt(3)")    List elements with an index less than 3
      :not(selector)$("input:not(:empty)")  All input elements that are not empty
    
        :header $(":header")    All header elements h1, h2 ...
        :animated   $(":animated")  All animated elements
    
     :contains(text)$(":contains('W3Schools')") All elements which contains the text
        :empty  $(":empty") All elements with no child (elements) nodes
        :hidden $("p:hidden")   All hidden p elements
        :visible    $("table:visible")  All visible tables
    
        s1,s2,s3    $("th,td,.intro")   All elements with matching selectors
    
    [attribute] $("[href]") All elements with a href attribute
    [attribute=value]$("[href='default.htm']")  All elements with a href attribute value equal to "default.htm"
    [attribute!=value]$("[href!='default.htm']")    All elements with a href attribute value not equal to "default.htm"
    [attribute$=value]$("[href$='.jpg']")   All elements with a href attribute value ending with ".jpg"
    
        :input  $(":input") All input elements
        :text   $(":text")  All input elements with type="text"
        :password   $(":password")  All input elements with type="password"
        :radio  $(":radio") All input elements with type="radio"
        :checkbox   $(":checkbox")  All input elements with type="checkbox"
        :submit $(":submit")    All input elements with type="submit"
        :reset  $(":reset") All input elements with type="reset"
        :button $(":button")    All input elements with type="button"
        :image  $(":image") All input elements with type="image"
        :file   $(":file")  All input elements with type="file"
    
        :enabled    $(":enabled")   All enabled input elements
        :disabled   $(":disabled")  All disabled input elements
        :selected   $(":selected")  All selected input elements
        :checked    $(":checked")   All checked input elements
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know you can combine multiple table-selects using a Join statement but is there
I have a query that I know can be done using a subselect, but
I'm trying to select all input elements on a page, but not the ones
I'm trying to fire custom events using jquery but for some reason I can't
I know I can SELECT 5 AS foo and get the resultset: foo 5
You can select a part of a web page with the mouse. I know
Does anyone know of a script that can select all text references to URLs
How can I select the next node after an defined comment? I know the
I would like to know how can I use jQuery to select multiple items
You can know if the event stack is empty calling the gtk.events_pending() method, but

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.