How can I store a style value in a cookie?

11 Views Asked by At

Hi,

I have html like this:

<div id="myelm" style="color:black;font-weight:bold;">

I want to store the style value in a cookie like this:

setCookie('mystyle', myelm.getAttribute('style'));

however only the part before the first semicolon is stored, ignoring all the rest. How can I bypass that?

Thank you.

0

There are 0 best solutions below