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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:56:25+00:00 2026-05-25T16:56:25+00:00

I have form with actively populated elements, something like: <input id=id1 type=button name=some_name> <input

  • 0

I have form with actively populated elements, something like:

<input id="id1" type="button" name="some_name">
<input id="id2" type="button" name="another_name">

etc.

My options are limited here.

I do not know id, as it is assigned by system dynamically (see: 1,2 next to id), so I cannot call JQ function by #.
Order of elements change, they are shown in different sets etc.

Class manipulation is not practical.
Same goes for any other attrib – pretty much – some are used, some may be used – again – dynamically, so I do not want to mess with it.

I can attach a js event thou (during form generation), e.g. onClick to particular, desired item.

<input id="id1" onClick="myFunc()" type="button" name="some_name">
<input id="id2" type="button" name="another_name">

I would not need to know id, class or anything in standard JS, since if element with myFunc is clicked, function is fired.

Is it possible to accomplish something similar with JQ?

  • 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-25T16:56:25+00:00Added an answer on May 25, 2026 at 4:56 pm

    Since you can attach your onlick event inline, why not add a class at that point instead?

    Adding a class to your input will allow you to hook into it easily with jQuery.

    <input class="myClass" [...] >
    
    $('.myClass').click(function(){ [...] });
    

    Update

    To directly answer the question you seem to be asking, no, jQuery doesn’t have a unique way of firing events inline by using the HTML binding attributes.

    However, any function you create in Javascript can be fired inline. I do not recomend this approach since it’s outdated and violates the seperation of concerns.

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

Sidebar

Related Questions

I have form like this: <input type='text' name='people' id='namepeople'> <input type='hidden' name='idpeople' id='idpeople'> <input
I have form: <form method='post' action='script.php'> <textarea id='main' name='text'></textarea> <input type='hidden' name='id' value='1'> <input
I have form where before i was using simple post with <button name=submit id=register
I have form for example: <input type=text /> <input type=file /> <input type=submit />
I have form area in my view. If I click button A , I
I have form with one input for email and two submit buttons to subscribe
I have form with 1 button. when you click on the button 3 others
I have form with few buttons and I want to know what button is
I have form, where some fields are looks like rows, so I can add/delete
I just wondering if it's safe to have form actions like this one: form

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.