Skip to content
Advertisement

So I’m making an Editor website, and I want to have a save button that will only save the code written in the box, and not the entire editor code

So, as I mentioned I am making an HTML, CSS and JavaScript editor and I need a save button, but I’m not sure of the code for it. I know a code that will make it save the entire code (script) for the editor, but I don’t want that, I want to make a Save button that will only save what the visitor types in the text box!

Bellow is my button codes! NOTE: I only need the “Save Button” code!

Code

JavaScript
JavaScript

Advertisement

Answer

You can get what the user has typed in your textarea using the .value property and get the data that the user has written.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement