Store condition | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Store condition

I want to store a condition after I pressed a button and reset it when I press an other. Is there a way I could do this? Ps: My script updates itself every second so if i press a button it only lasts till the next second

25th Dec 2016, 11:10 PM
Peter Ehlert
Peter Ehlert - avatar
2 Answers
+ 2
"My script updates itself every second" You mean: script reload the page every second? or just edit the dom ( html ) content? If second, global variables would be sufficient ( you can also store strings values in attributes of html elements: input are designed for that, with attribute "value" and property "hidden", but you can also do it with you own attribute on any element ) Else, look at html5 localStorage object, or cookies if you don't support html5 ( or want to be old browsers compatible )
26th Dec 2016, 9:44 AM
visph
visph - avatar
0
Look for KeyReleaseListener
25th Dec 2016, 11:58 PM
Andreas K
Andreas K - avatar