function mutevideo(evt) {
if (evt.target.classList.contains('fa-video-camera')) {
evt.target.classList.remove('fa-video-camera')
evt.target.classList.add('fa-video-camera:after') // need here above fontawesom class with slash
} else {
evt.target.classList.remove('fa-video-camera:after') // need here above fontawesom class with slash
evt.target.classList.add('fa-video-camera')
}
}
.fa-video-camera:after {
position: absolute;
content: "/";
color: white;
font-weight: 900;
font-size: 20px;
left: 10px;
top: 7px;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<p class="bg-white text-danger rounded-circle"><i onClick=mutevideo(evt) class="fa fa-video-camera p-2 fa-1x"></i></p>
Problem:-
In fontawesome 4.7 version it don't have slash video as it have in version of 5.x, so here i wrote my own css with :after to make this achieve, Now how where i will get video slash as soon as page loads, but my requirement is i need slash on icon after i click.
Note:-
here i'm using fontawesome version 4.7, any help or suggestion are heartily thank you
:afterlike this in JS as its not part of the DOM so it will not able accessible.:after(or::after) in CSS refers to adding content after an element; it's not part of the class name, and has nothing to do with "after it's been clicked".