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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:51:51+00:00 2026-05-15T00:51:51+00:00

Here is a code: <input type=button id=array[1] value=Value1 /> <input type=button id=array[2] value=Value2 />

  • 0

Here is a code:

<input type="button" id="array[1]" value="Value1" />
<input type="button" id="array[2]" value="Value2" /> 
<input type="button" id="array[3]" value="Value3" /> 

And I want to do something like that:

$('#array').click(function() {
    id = this.id;       
    $.ajax({
        here goes type, url, data and else
    });     
})  

I want to id add array’s number. For example, if I click button where id is array[3] so id gets value of 3 in Jquery’s function. Hope you got what I mean.

  • 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-15T00:51:52+00:00Added an answer on May 15, 2026 at 12:51 am

    First of all you should not be using [] in id values … only a-zA-Z0-9-_.:

    look at the html ID attribute for more info on the specs..

    you should name them something like id_1 and extract the number with regular expressions like the other answers suggest…
    (remember that you cannot start the id value with a number only a-zA-Z)

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

Sidebar

Related Questions

This is my html Code: <input type=checkbox name=test id=test /> Here i want to
Here is my jquery code: $('input').click(function(){ $('h1').empty().queue(function(){ console.log('queue'); }); }); }); Only the first
Here is the code I am having: <div id=removequestions></div> var html += '<input type=radio
Here's the relevant code: <div data-bind=foreach: chats, visible: chats().length > 0> <input data-bind='value: $parent.newCommentText'
I tried to change the HTML form, input type file. Here is my code:
Here is my code: $('.button').click(function() { $(this).addClass('clicked'); $('.button').not(this).removeClass('clicked') .addClass('not_clicked'); $('#tool_window,#wrapper').not('#work_area').not('.button').addClass('outside'); }); $('.outside').click(function() { $('.clicked').removeClass('clicked');
Here is the input form code <tr valign=top> <td align=right class=innertablestyle><font class=normal><strong>Homepage</strong></font></td> <td>&nbsp;</td> <td>
Here's my code: sentenceToTranslate = raw_input(Please write in the sentence you want to translate:
Here is the code: string str; cin>>str; cout<<first input:<<str<<endl; getline(cin, str); cout<<line input:<<str<<endl; The
Here's what I'm trying to do, simplified: <input rel=TimeStart> // bunch of HTML code

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.