Hello i trying to create a little diary using jquery,
i have a script where you enter in the textbox then it displays it in a div with a delete button. how do i make it so when i go back to the page the text is still the but i only want to be able to do this in jquery or javascript or html.
Here Is My Script
<script src="http://code.jquery.com/jquery-1.5.min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
$(window).load(function(){
$('#Subject').keypress(function(event) {
if (event.which == '13') {
event.preventDefault();
$('#subject').append('<div>' + $(this).val() + ' <span onclick="$(this).parent().remove();"><img src="images/close.png" width="15" height="15" /></span> </div>');
$(this).val('');
}
});
});
//]]>
</script>
<body>
<div data-role="page" id="page">
<div data-role="content">
<input id="Subject" value="subject" onClick="value=''" />
<div data-role="controlgroup"><a data-role="button"><div id="subject"></div></a>
</div>
</div>
</div>
</body>
I know ive asked too much already but can anybody tell me how the change it from the enter key to a button