<html> <head> <meta charset="utf-8" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(function () { $("#btn").click(function () { var obj = { name: "Peter", age: 10 }; if (localStorage.data == undefined) localStorage.data = JSON.stringify(obj); var obj = JSON.parse(localStorage.data); obj.age++; localStorage.data = JSON.stringify(obj); $(this).val(obj.age); }); }); </script> </head> <body> <input type="button" id="btn" value="請按我" /> <hr /> <svg width="1000" height="800"> <ellipse cx="150" cy="150" rx="60" ry="30" fill="red"> <animateTransform attributeName="transform" type="rotate" from="0 150 150" to="360 150 150" dur="2" repeatCount="indefinite" /> </ellipse> <!-- <circle cx="150" cy="150" r="40" stroke="green" stroke-width="4" fill="yellow"> <animate attributeName="r" to="100" dur="3" repeatCount="2" /> <animate attributeName="cx" to="300" dur="2" repeatCount="3" /> </circle> --> </svg> </body> </html>