简体   繁体   中英

How to get element by id of previous page after using window.history.back()?

使用 windows.history.back() 后,我可以通过上一页的 id 获取元素吗?

Save it in local storage on the first page

localStorage.setItem('item', $('#elementID').val());

Then retrieve it from the second


localStorage.getItem('item');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM