jquery - How to keep variable's value using localstorage? -
for example have draggable here , once if statement true store 1 in winner variable. after refreshing page or going page still keep value because i'm planning call variable again. how keep variable's value in local storage?
set variable local storage :
//you store key ie. "winner" , value (your variable) localstorage.setitem("winner", winner) //then value winner = localstorage.getitem("winner")
Comments
Post a Comment