Actually we cant create a static variable at client side. But we can keep the value even after page postback using Hidden field control.
First we need to create a hidden control and need to set ClientIDMode as "Static"
Ex: <asp:HiddenField ID="hndControl" ClientIDMode="Static" runat="server" />
After that we need to assign the value to that hidden field.
document.getElementById('<%= hndControl.ClientID %>').value = "Static";
Here after we can use that value until we change hidden field value.
First we need to create a hidden control and need to set ClientIDMode as "Static"
Ex: <asp:HiddenField ID="hndControl" ClientIDMode="Static" runat="server" />
After that we need to assign the value to that hidden field.
document.getElementById('<%= hndControl.ClientID %>').value = "Static";
Here after we can use that value until we change hidden field value.