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 6195221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:25:53+00:00 2026-05-24T03:25:53+00:00

I have following form. <form action= method=post id=save-user> <button type=button name=save-user>Save</button> <button type=button name=save-user-close>Save

  • 0

I have following form.

<form action="" method="post" id="save-user">
    <button type="button" name="save-user">Save</button>
    <button type="button" name="save-user-close">Save & Close</button>
    <input type="text" name="name" placeholder="Enter your name" required/>
    <input type="email" name="email" placeholder="Enter your email" required/>
</form>

I am confused on how do i create a jQuery selector for all the inputs and buttons elements, as i am not using an id attribute, i do not want to use it in this case. how do i retrieve or create selector for all the four form elements.

thank you.

  • 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-24T03:25:53+00:00Added an answer on May 24, 2026 at 3:25 am

    All of the above answers are ok, but you can, and most certainly should, learn and (learn to) use advanced selectors such as pseudo classes, attribute selectors and more.
    Here are a few examples for you case:

    // all the buttons that are children of the container 
    //with the attribute id equal to "save-user"
    $("#save-user").find('button');
    
    // all the buttons that have their name attribute starting with "save-user"
    $('button[name^=save-user]'); 
    
    // same as before, only that we filter the results
    // by checking if they contain the text "Save"
    $('#save-user').find('button').filter(':contains(Save)');
    

    You can create even more complex queries only with the use of jquery selectors – withouth the need to bind an id or class to the elements – to suite your needs. Of course, the main downside would be efficiency, but if you don’t abuse the special selectors, your jquery coding-style can be quite cool.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following form <form action=ManageLink method=post> <input name=artistName type=text/> <input name=songName type=text/>
I have this form: <form action= method=post> <label for=color>Color:</label> <input type=text style=width: 195px; name=color
I have a form with the following HTML below: <form id=course_edit_form name=course_form action=/courses/save method=post>
I have the following form <form id=upload method=post EncType=Multipart/Form-Data action=reciver.aspx> <input type=file id=upload name=upload
I have the following form <form name=myForm id=myForm method=post enctype=multipart/form-data action=script.php> and this jQuery
I have the following form on an .NET MVC View: <form method=post enctype=multipart/form-data action=/Video/UploadDocument>
i have the following html code : <FORM name=frmmail> <input id=dochtmlContent type=hidden name=dochtmlContent value=oldValue/>
I have the following form <form id=myform method=post action=#> <div class=fields> <fieldset class=ui-widget ui-widget-content
I have an included object's form: <form method=post class=object_form id=event-core-form action={% url save_event_core_data event.id
I have done the following form <% form_for @anexo, :url => {:action => create},

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.