How to remove data-badge on an a tag with onclick

Hi guys,

I’ve an anchor tag that look like this:

<a href="#" id="badge" data-badge="1"><img src="path_to_img" alt="New Message"  /></a>

If you view it in the console it would look like this:

<a href="#" id="badge" data-badge="1">
     "<img src="path_to_img" alt="New Message"  />"
     ::after
</a>

How do I get rid of the ::after or change data-badge value when I click on the link.

Note: no jQuery [and it would be done after ajax callback success → I’ve done this part].

Thank you,

Are you sure you want to remove it?

Discourse / Ember uses that very syntax here to do it’s magic.

Is it causing a problem or do you just not like seeing it in the console?

I don’t really want to remove it. I just want it disappeared.

It’s notification system like on the top right of this forum. When you click on the alert message it’s gone.

I just want something like that.

Thanks

Well, easy. Just change class name.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.