Response title
This is preview!
Ok I am trying to change the value of button id="pause" through the function Pause()
but I am having no luck!
<form action="javascript:void(null);" id="theTimer" name="theTimer">
<input id="timerDisplay" type="text" name="theTime" readonly="readonly" />
<br />
<input type="submit" name="start" id="start" value="Start" onClick="Start()"/>
<input type="submit" name="stop" id="stop" value="Stop" onClick="Stop()"/>
<input type="submit" name="pause" id="pause" value="Pause" onClick="Pause()"/>
</form>
function Pause() {
if (timerID) {
clearTimeout(timerID);
}
if (myTimer) {
clearInterval(myTimer);
}
if ($('#pause').val() == "Pause") {
$('#pause').val("Resume");
} else {
$('#pause').val("Pause");
var tToday = new Date();
var total_time = tToday.getTime() - tDiff;
var tStart = new Date(total_time);
timerID = setTimeout(UpdateTimer, 1000);
startTimer();
}
}
I am new to javascript in general and I am assuming that jQuery Mobile is not allowing the
value to change since it uses it to format the buttons accordingly... so how can I change them
using JS, or jQuery or Mobile?
© 2013 jQuery Foundation
Sponsored by and others.