Below is a for loop with an alert. The code is pretty self explanatory, in case of any doubts or suggestion please use the comment section below and I shall get back to you.
for ( i = 0; i <= count; i++ )
alert( “current count is : “ + i );
Demo : Click here to run the above method with a count of ‘5’