I have this code here:
HTML: <button class="btn btn-danger btn-circle delete" type="button"><i class="fa fa-remove"></i></b</td>
$('#submit1, #submit2').click(function () {
if (this.id == 'submit1') {
alert('Submit 1 clicked');
}
else if (this.id == 'submit2') {
alert('Submit 2 clicked');
}
});
I'd like to pass a class instead of an id , how do I? Should I use this.class
instead of this.id
? and pass:
$('.submit1, .submit2').click(function () {
if (this.class == 'submit1') {
alert('Submit 1 clicked');
}
});