It is really bad for you to get the onion juice in your eyes. Your eyes will feel uncomfortable and get watery with no control. You should just wash the eyes with clean water as soon as possible. Then you should dry the eyes with clean cloth. At last, you could also use the warm compress to make your eyes feel comfortable.
Don't worry about it as our eyes get its own clean system.The burning is a signal to stimulate the tears,which can wash away the juice after a while.However if you just can not stand the burning,you can wash your eyes under the running water and try to blink them for several times to get the juice out quicly.And what you are not supposed to do is grabing your eyes,which can let virus on your fingers in your eyes may cause infection.
As you may have dealt with it already,hope that this can be a good advice when you confront with similar situation next time.
Calm down, dude. I know it hurts a lot, but it won't actually harm your eyes. Just rinse your eyes until you feel better. As long as foreign bodies enter your eyes, your eyes get irritated and shed tears immediately. This process itself is a way of protecting your cornea conducted automatically by your own eyes. Onion juice is nothing to worry about. Wash away the juice in your eyes and be careful next time you are cutting onions or something.