I am trying to hold what I save in nearby storage on the page, that manner if I were to refresh I would still have something I entered within the text area field.
But I am not positive if it is because I am the use of a variable that assigns to e. The goal then the relative course to what I'm seeking to shop, however after I console.Log my variable it says it's not described and I am assuming that my difficulty is due to the fact I don't completely understand jquery.
function updateHours() {}
function handleSave(e) {
var value = $(e.target).siblings('.description').val()
var hour = $(e.target).closest('.time-block').attr('id')
localStorage.setItem(hour, value)
}
function main() {
updateHours();
$(document).on('click', '.saveBtn', handleSave)
console.log(localStorage.getItem(value))
}
$(document).ready(main)
0 Replies