views:

59

answers:

2

The jquery way is

$("#id:hidden:first")

$("#id:visible:last")

What's the Protoytype ways?

I try using $$(), and it doesn't work.

could somebody tell me? thanks a lot.

+2  A: 

This should work:

$$('#id[style="display:none"]:first')

this should be faster:

$$('#id[style="display:none"]').first()

See

karim79
Thanks, this works.I readly appropriate it.
Jim
+1  A: 

Hope this is what you are looking for

$$('#id[display=none]:first');
rahul
thank you very much.
Jim
but I have a additional question, because I try $$('#id[style="display:block"]').first()seems doesn't work.what I thouth is $$('.class').each(function(i){ //get first element style != block here.})but I think this way is not simple enough.do you have any idea?
Jim