我從 W3Schools 獲得了以下代碼,但我想知道如何在頁面重新加載后保持復選框值:Keep HTML: <input type="checkbox" ng-model="myVar"><div ng-if="myVar"><h1>Welcome</h1><p>Welcome to my home.</p><hr></div><p>The DIV element will be removed when the checkbox is not checked.</p><p>The DIV element will return, if you check the checkbox.</p>現在,如果您選中該框并重新加載頁面,該復選框將再次取消選中。即使在重新加載后,您如何使復選框保持其值?謝謝!
Angularjs:如何在重新加載后保留復選框值
米琪卡哇伊
2021-07-14 13:00:15