title: Store data in html element
body: <p>I have dynamic content which I generate with PHP, and i want to store some various text in <code>data</code> attribute. Bu the problem is that i need to escape various characters that could damage my entire html</p>
  
  <p>So I need to do some kind of encoding with php and then decode that string with javascript when  i want to use that data, what would be the best way to do that?</p>
  
  <p>And just to clarify i do not want to use any inputs or anything like that, i need to store this data in various elements for example <code>a</code> or <code>div</code> and so on... </p>