I'm making my first website and have come to a block in the road so to speak. I have a few pages of html and css and now I need this counter that will loop between 1 and x, I will have to input x via the keyboard (user side). I would rather not use a prompt window but rather an input type textbox for the variable. When I click the stop button, I want this to write the number that the counter was stopped on and then start again and keep doing this same cycle over for ten times. I have spent three days trying to figure this javascript out and am getting a headache. Can someone point me in the right direction? Is there a better way of doing this or am I on the right track?
Here's what I have so far...

<script type="text/javascript">
var c=0;
var t;
var timer_is_on=0;

function timedCount()

function doTimer()
if (!timer_is_on)

function stopCount()

<input type="button" value="Start count!" onclick="doTimer()"><br/>
<input type="text" size="10" id="txt"><br/>
<input type="button" value="Stop count!" onclick="stopCount()"><br/>
I hope this is posted correctly!!! Thanks for any suggestions.