Fox Asked:2020-12-18 00:36:22 +0000 UTC2020-12-18 00:36:22 +0000 UTC 2020-12-18 00:36:22 +0000 UTC 页面重新加载后的输入缓存 772 告诉我,重新加载页面后是否可以重用输入字段的值?那些。什么样的缓存(cookie)字段(输入)?这样在重新加载后,在字段中输入值的用户将再次在字段的同一字段中看到相同的值。对此实施有什么想法吗? javascript 1 个回答 Voted Best Answer Arendach 2020-12-18T00:49:21Z2020-12-18T00:49:21Z jQuery 饼干 $(document).on('keyup', 'input', function(){ $.cookie('input_' + $(this).attr('name'), $(this).val()); }); ... $(document).ready(function(){ $('input').each(function(){ $(this).val($.cookie('input_' + $(this).attr('name'))); }) });
jQuery 饼干