I have a list of paragraphs in a chatbox:
<div id=chatbox>
<p><i>15:21</i><b data-c=john>john</b>: hello jack</p>
<p><i>15:22</i>i want to tell you something</p>
<p><i>17:17</i><b data-c=jack>jack</b>: hi john.</p>
<p class=hidden><i>20:15</i>Ο <span data-c=server>server</span> alex joined the chat</p>
<p><i>17:17</i><b data-c=alex>alex</b>: hi all of you.</p>
</div>
and I want to have a toggle button in order to show/hide the hidden elements. Is there a way to toggle the style of hidden
class from display:none
to display:inline
and backwards?
Notice that if i change all existing class=hidden to visible, when AJAX brings a new hidden line, it will still be hidden in contrast with previous elements. Is there a way to change the content of a class style?