I have a server control which has four buttons without id's, They are however having two css classes assigned to each pair. I need to find whether click()
event exists for these button using their class as their Identifier. SO in order to get the list of events associated with these elements I used the $._data()
method to get he list of events.
$(document).ready(function () {
var events = $._data($('.dxWeb_pNext_DevEx1')[0], 'events');
for (var i = 0; i < $._data($('.dxWeb_pNext_DevEx1')[0], 'events').length(); i++) {
alert(events[i].toString());
}
});
However I am not able to retrieve the events. The other method I tried was to check if the said element was visible or enabled and if so I trigger a click if not I do nothing. Now I need some help on whether we can do it in second way.
Here the problem is the element doesn't have an ID and we have to identify it using its class which is applied to 2 buttons(Next buttons precisely). So either both are enabled or disabled any moment of time, can we use this to our advantage. The control shows records pagewise, buttons I mentioned are Next and previous button in header and footer of the control.