As the title says, I would like to add a new hidden attribute to an element. To avoid any confusion, I want the attribute to be hidden, not the element.
I have a div: <div id="hello_div">Hello!</div>
I add an attribute: $('#hello_div').attr('my_attr', 'attr_value');
So I can get it later: var v = $('#hello_div').attr('my_attr');
It works as expected but if you inspect the div
in the DOM Explorer, you see:
<div id="hello_div" my_attr="attr_value">Hello!</div>
Is there any way to hide this attribute?