I believe the key part of your question is here: and it should be updated
I suspect you mean that you want the text typed by the user to be saved somehow.
You have two options: front-end (localstorage
) and back-end (PHP or ASP.Net
)
For localstorage, the code to save looks like this:
localStorage.setItem("cardbody", "This is what they typed");
and to retrieve it:
$('.update-card-body').text(localStorage.getItem("cardbody"));
For PHP, you can either use a <form>
or use AJAX:
References:
localstorage info
PHP Forms
Info about AJAX
Note: PHP is very common - it comes with most shared hosting packages (GoDaddy, Hostgator, Namecheap, etc). If you wish to play with it on your local computer, install a free package called XAMPP - it has OSX, Windows and Linux distros. Note that files go into xampp/htdocs
, and you view the website by typing ONLY localhost
into the browser address bar.