Ive been trying to figure out how to get some data i type into a text field to save on the screen underneath it. Something like a twitter, or Facebook news nothing fancy. I’m using JQM and would like this to get save on the same page as the text field and button under the
<div data-role="content">
This is what i have for a field and button.
<input type="text" id="Text"/>
<input type="button" id="Button" value="Submit" />
<div id="buttonPlaceHolder"> </div>
and this is some javaScipt i found to go along with the button, it works however the dollar signs screw up JQM and ive tried putting it in its own js file. I think i might be doing something wrong.
$('#Button').bind('click', function() {
$('#buttonPlaceHolder').append($('#Text').val());
// refresh jQM controls
$('#home').trigger('create');
});
If at all possible id like the javascript in with the html via script
I am not sure if I understood the question. Nevertheless try this, it may help:
It is a html page example. You can find more info and useful examples here:
http://www.w3schools.com/js/js_examples.asp
If you want to save it for later use, try localStorage mechanism.