Hi All, I have my source code as- ----------------------- <table> .... .... </table> <img alt="Minusicon" class="float_right" onclick="showHide(this)" src="/images/minusIcon.gif?1293788761" /> <a href="#" onclick="showHide(this); return false;">ABCDEFGHI</a> <table> .... .... </table> and then again image and a href(link) ------------------------ I try to find the next and prev element when i click on any link. So i have done it like this in JS file:- function showHide(elem) { var table = elem.next("table"); // done whatever to be done with table. var image = elem.prev("img"); // This code is not working out. Although the syntax and semantics are same. } Can you guys light me that what i am doing wrong here. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.