var x=prompt("Enter 1 t0 10 ,"");try { if(x==1) { throw "One"; } else if(x<5) { throw "X greater five"; } }catch(Error) { if(Error=="One") { document.write("Error 1."); } if(Error==X greater five") { document.write("Error 2); } }
Login to post response