-1

I'm noob and I need help. I want to change the Class name when I enter the Web

Here is the Html :

<div class="row innerbodypanel">
    <form name="AGX" id="AGX" action="" method="post" autocomplete="off">
</div>

I want to change the Class (row innerbodypanel) to a empty like Class=""

theduck
  • 2,589
  • 13
  • 17
  • 23
  • 3
    What is stopping you? – B001ᛦ Jan 06 '20 at 14:45
  • 1
    Does this answer your question? [How to change an element's class with JavaScript?](https://stackoverflow.com/questions/195951/how-to-change-an-elements-class-with-javascript) – T. Short Jan 06 '20 at 14:46
  • Does this answer your question? [Clear element.classList](https://stackoverflow.com/questions/15040297/clear-element-classlist) – Mr. Polywhirl Jan 06 '20 at 14:51

4 Answers4

1

use jQuery removeClass
$(".innerbodypanel").removeClass("row innerbodypanel")
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="row innerbodypanel">
<form name="AGX" id="AGX" action="" method="post" autocomplete="off">
Mohamad A Sallal
  • 614
  • 6
  • 12
0

You could use the className property to change it to an empty string ('')

document.querySelector('.btn').onclick = () => {
  document.querySelector('.row.innerbodypanel').className = '';
}
.row {
  background-color: red;
}

.innerbodypanel {
  color: white;
  font-weight: bold;
}
<div class="row innerbodypanel">test!</div>
<form name="AGX" id="AGX" action="" method="post" autocomplete="off"></form>
<button class="btn">click me !</button>
Nicolas
  • 8,077
  • 4
  • 21
  • 51
0

try like this

<div id="A" class="row innerbodypanel">
   <form name="AGX" id="AGX" action="" method="post" autocomplete="off">
</div>

$("#A").removeClass("innerbodypanel")
Ishwar Gagare
  • 723
  • 3
  • 9
0
$(document).ready(() =>
{
    $("div").removeClass("row innerbodypanel");
});

This will remove the class when the entire page is loaded. Thus, there is no danger that the removeClass function will be executed before the div element is loaded. Also you will maybe need an id for the div because the "div" selector is very generic.

grandidark
  • 29
  • 5