I need to get access to element which was generate dynamically in jQuery.
Thing which I want make is hide first and last elements which are generated by kendoUI grid element.
$(".myItem").first().hide();
$(".myItem").last().hide();
So I know if I have some event for example click on generated element I can use .on() or .live(). But I don’t have any event in this case.
How can I fix it? Any help would be appreciated.
If you have a known structure then you can get the nearest thing with an ID and work your way to it. Methods like
parent(),nearest(), andchildren()will let you move your way over to the main grid container div and then you can use the:firstand:lastpseudo elements.You can use the databound event as outlined here to hook into it after the rows have been created:
Example: