javascript - Save to localstorage onclick not working -
trying save variable textfield localstorage onclick
of button can't seem find way out. when click on button , go check localstorage section in chrome found nothing
$('.save').on('click', function(event) { $username= $('#username') localstorage.setitem('username', $('#username').val()); });
html
<input type="text" name="username" id="username"> <input type="submit" name="button" id="button" value="submit" class="save">
Comments
Post a Comment