I want to perform an action when I click on a div, but that div is generated dynamically according to the records of the BD, so its id could always vary. For example:
id="identificador1", id="identificador2", id="identificador3"
so I should know in which of those divs you click on it so that then an edit form of that plant appears.
Code:
for (var x = 1; x <= conteo; x++) {
$("#editar"+x).bind('click', $.proxy(function () {
alert("div"+x);
}, this));
}
This code is what gives me an alert with value "div11", the point is that I have a limit of 10 plants and that value that gives me back is static.
In summary:
I want to know which div is clicked without naming it statically.