function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rahul AlladaRahul Allada 

How to get Id of a element using class name, or how to remove the class name?

Hi All,

I have an anchor tag with the class name "Active". How do I get the Id of the tag with the class name "Active"? Or how can i change the class="active" to class=" "? 
<a aura:id="Home" href="{!v.status}" id ="dashboard" class="active" alternativeText="DASHBOARD" title="DASHBOARD"> 
</a>
Please help me with this? Any one of the solutions is fine for me.
Suraj Tripathi 47Suraj Tripathi 47
Hi Rahul Allada,
Greetings!

You can remove the class of your tag by this:
<script>
function rm() {
  var a= document.getElementById("dashboard");
  a.classList.remove("active");
}
</script>
If you find your Solution then mark this as the best answer. 

Thank you!

Regards,
Suraj Tripathi