I have a question regarding jQuery. I have a li
that slides out, now I want to remember if it has slided out so I want to set a boolean variable slidedOut
.
Is it possible to simply add it to the element? Or should I add a hidden div
or something to to element?
You can use .data()
for this.
Something like
$("#yourli").data("slidedOut", false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With