Lavi
Lavi

Reputation: 13

How to save the text that the user enters in a text box using javascript and HTML only

I am making a journal website and there is a page where the user can enter any amount of text into a textbox.

I want to save this text as a .txt file locally on the system when the user presses the save button (the button is already made).

I have seen users use jquery and whatnot but is there a way to do this using just javascript and HTML?

<h1 class="auto-style1">My journal</h1>
<br />
<sub>
    <div class="a">
        <textarea id="InputBox" style="height: 400px; width: 1200px" placeholder="Enter your journal entry here"></textarea>
    </div>
<div class="auto-style1"></div>
<br />
</sub>
<br />

<p class="auto-style1">
 <button id="SaveButton" onclick="save()">Save</button>

I have created a button but I am genuinely not sure how to create a .txt file from the text the user types into textarea.

Upvotes: 0

Views: 24

Answers (0)

Related Questions