我正在尝试localStorage并尝试从div获取文本并将其存储在localStorage中,但是,它将其设置为[object Object]并返回[object Object].为什么会这样?
localStorage.content = $('#test').html('Test');
$('#test').html(localStorage.content);Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="test"></div>Run Code Online (Sandbox Code Playgroud)