You may be stuck when you need to find the last visible element using jQuery/javascript. For finding the last visible element,look at below jQuery code.  You need to use Visible selector with last selector of jQuery.