So I've got this script that outputs a random number between 0 and 100 every time you click on the button
$(document).ready(function(){
for ( i = 0; i < 1; i++ ) {
$('#btn').on('click', function(){
var randNum = 0;
var randNum = Math.floor(Math.random() * 100);
$(".result").html(" "+randNum);
});
};
});
You can do this:
$(document).ready(function(){
$('#btn').on('click', function(){
var randNum = 0;
var randNum = Math.floor(Math.random() * 100);
var winlose = randNum >= 60?'You win':'You lose';
$(".result").html(winlose + ' ' +randNum);
});
});