I want to write a html code to enable downloading a user entered input value saved in a text file. As in the below html, when the 'Save' button is pressed, the input value should save in the user computer as a .text file.
<html>
<head>
<script type="text/javascript">
function write_below(form) {
var input = document.forms.write.input_to_write.value;
document.getElementById('write_here').innerHTML = "Your input was:" + input;
return false;
}
</script>
</head>
<!--Insert more code here-->
<body>
<form name='write' onsubmit='return write_below(this);'>
<input type="text" name='input_to_write'>
<input type="button" value="save" />
</form>
<div id='write_here'></div>
</body>
</html>
Can anyone help me in this problem?