Forum Moderators: open
<p><a id="testlink" onclick="Coin(); Test();">test link</a></p>
<p id="c2" style="display:none;">2</p>
<p id="c3" style="display:none;">3</p> function Coin(){
var c = Math.random();
return (c < 0.5) ? [2, $('#c2').show('slow')] : [ 3, $('#c3').show('slow')];
}
function Test() {
if('Coin() return < 0.5') {$("#testlink").css('color','green')}
else if('Coin() return >= 0.5') {$("#testlink").css('color','red')}
}
if('Coin() return < 0.5') if('Hello World') {....} if (Coin() < 0.5) {....} if (something < 0.5) {
// ....
} else if (something >= 0.5) {
// ....
} if (something < 0.5) {
// ....
} else {
// ....
}