I've made a day planner and realised I never set the input up to save to local storage. I'm not very familiar with saving to local storage and quite frankly don't know where to start, and the examples I'm seeing online are very different from the format of my code so they're hard to follow. Any tips?
$(function(){
$(document).on('click','.edit_btn' , function(){
let editable = $(this).prev('.edit_cont').attr('contenteditable');
if(editable){
$(this).text('edit');
$(this).prev('.edit_cont').removeAttr('contenteditable');
$(this).prev('.edit_cont').removeClass('edit_cont_border');
}
else{
$(this).text('save');
$(this).prev('.edit_cont').attr('contenteditable','true');
$(this).prev('.edit_cont').addClass('edit_cont_border');
}
})
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class = "container" spellcheck="false">
<div class = "row my-row">
<div class = "col my-col col-a1 colorcode" id = "9"> 9am </div>
<div class = "col my-col col-a2 edit_cont" > </div>
<div class = "col my-col col-a3 edit_btn"> edit </div>
</div>
<div class = "row my-row" >
<div class = "col my-col col-b1 colorcode" id = "10"> 10am </div>
<div class = "col my-col col-b2 edit_cont"> </div>
<div class = "col my-col col-b3 edit_btn"> edit </div>
</div> (+6 more rows)