-1

I have a span like that

<span class="btn btn-sm btn-twitter" id="Teacher" >TheTeacher</span>

I want to add x char character with class so, when i write this code

$("#Teacher").addClass("ClassOfX");

I want to get this result inner the button

Image 1

When i write this code

$("#Teacher").removeClass("ClassOfX");

I want to get this result

Image 2

I want to code like that. Can i create it ??? I dont want to add element inner the span tag.. because i have alot of code to get inner span text..

InsertState($("#Teacher").text());

I can't rebuild this code block because i can mistake one of the code. I have alot of code like InsertState function.

Zibian Domichi
  • 185
  • 1
  • 11

1 Answers1

1

You can have:

classofx::before {
  position: relative;
  content: 'x';
  top: 0;
  right: 0;
  color: black;
} 
m3characters
  • 2,240
  • 2
  • 14
  • 18