I am using jaquery and jquery mobile version 1.8 and I have a button like so:
<div class="ui-bar-a" id="myButton" style="bottom:0;position: fixed;width: 100%">
<input type="submit" name="Next" id="NextButton" value="Save" />
</div>
And I have a javascript that can change the text for it like so:
$('#AnyButton').live('click', function() {
if(true)
{
$('#myButton div').text('Saving')
}
else
$('#myButton div').text('Continue');
});
I tried so many other ways that didn't work but this works however after I change the text the button seems to replace the myButton div content with the text Saving or Continue and thus the button is no longer clickable.
In my browser debugger the button shows a text Save appear between myButton and the Nextbutton input.
Like so:
<div class="ui-bar-a" id="myButton" style="bottom:0;position: fixed;width: 100%">
"Save"
<input type="submit" name="Next" id="NextButton" value="Save" />
</div>
$('#myButton div').text('Saving')
, well yeah you instructed it to do so. If you want to change the value of the input then you should target the input$('#NextButton').val('Saving')
..live(
has been removed use.on('click', function
AND a newer version as 1.8 has security vulnerabilities and newer will be faster