I want to give max value to variable. The variable should not exceeds it's maximum value. I don't know how to do it. There is a javascript i created
var myvalue = 0
function click(){
myvalue = myvalue + 10
// I want to adjust max value for var myvalue that is 100.
if (myvalue > 100){
alert('this is max value')
}
}
Please no JQuery. Only Javascript
myvalue = 100; alert('this is max value');ifyou would need to assignmyvalue = 100;?