I have a html website with Sortable.js. I want to save the current state of the body when a user rearranges the list and clicks a save button. I don’t want it to save to local storage but directly to the hosted file, replacing the body html with the new rearranged version.
<body>
<div class='wrapper'>
<ul class='list'>
<li class='item' contenteditable='true'>Item 1</li>
<li class='item' contenteditable='true'>Item 2</li>
<li class='item' contenteditable='true'>Item 3</li>
</ul>
<button class='add-item'>add new item</button>
<button class='save'>save changes</button>
</div>
</body>I believe what I’m trying to achieve is very simple and can be done using php and ajax, but I can’t find any direct answer to my question.
Currently there is only one index.php file.
Security is no issue.
source https://stackoverflow.com/questions/69328939/how-to-save-current-state-of-html-body-php
Comments
Post a Comment