I have a table with dynamically created Edit buttons.
The ID of the buttons is a string that is appended with table content id.
i.e: <input id='edit'+id type='button' value='Edit' onclick=edit(this.id) />
How can i get the ID(=edit+id) value of the button using jquery.
Thanks.
You have to get a reference for the input element. Then, just call
If it had a class, for example, inputClass, you could do:
Here’s how I would approach your particular situation. You have:
I would replace this for:
Then, anywhere in your page, you write this piece of code:
this binds a function for each of the elements which call your edit function…