Afternoon guys....

Is it possible in javascript to give out 2 answers to a tenary
opertor.... (doesnt make sense i know - see below)

function foo(arg) {

return ($(arg)) ? true : alert('Element Does not exist');false;

(wrapped in window loaded function)

foo('bazzzzzzzzzzzzz'); // doesnt exist so i want it to alert the
alert and return false to halt the script.......

<div id="bar"></div>

Is this the right way to do it in the operator or cant it be done....
and no i dont want to make 2 functions i would like it in one if it
can be done.

Alex Mcauley
You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to