lets assume the following markup
a button |
a button |
a button |
a button
you want to be able to differentiate between the buttons on click event
var obj = $(".button");
obj.click(function(e) {
e.preventDefault();
var index = obj.index($(this));
alert("my button index is "+index);
});
this
Hello,
I need help.
I have thjis plugin
(function($){
$.fn.btnInit = function() {
function prepare(obj, caption, action) {
obj
.html(caption)
.addClass("fg-button ui-state-default ui-corner-all")
.click(function(){
// run the action here when click
2 matches
Mail list logo