简体   繁体   中英

jquery enable and disable elements based on button click

I have a button when clicked it disables a user from clicking anything on an element so something like this:

$( "#buttonid" ).click(function() {
   $("#test").css("pointer-events","none");
});

But once the user leaves the page and comes back the element is clickable again. How do I maintain the status to keep it unclickable?

您可以使用会话或Cookie。

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