0

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.

Cain Nuke
  • 2,843
  • 5
  • 42
  • 65
  • 1
    Does this answer your question? [Create cookie containing ";" character](https://stackoverflow.com/questions/11349155/create-cookie-containing-character) – lusc Jan 25 '22 at 18:39
  • No, it DOESNT answer my question. How come I am supposed to take the semicolon out if thats the correct syntaxis for a css declaration?? – Cain Nuke Jan 25 '22 at 18:48
  • It does answer your question. You replace all semicolons with `%3B` and it says why in the linked question. – lusc Jan 25 '22 at 18:51

0 Answers0