-3
I have a button PAUSE/PLAY
and wanted to click on PAUSE
were activated the class .carousel-control-next-icon
.
Here’s the excerpt from the code I want to insert class: .carousel-control-next-icon
when clicked.
<label id="myBtn2" for="play">
<i class="fa fa-pause" aria-hidden="true"></i>
</label>
I tried to do using onclick
, but I couldn’t.
#player{
position: absolute;
bottom: 40%;
right: 40px;
z-index: 999;
}
.controls i{
background: linear-gradient(180deg,#fff 0%,#ddd 100%);
padding: 11px 13px 11px 13px;
border-radius: 50%;
}
.controls i{
font-size: 20px;
color: #178F5D;
text-align: center;
transition: 1s;
transition: 100ms all ease;
}
.controls label {
position: absolute;
cursor: pointer;
}
#myBtn,
#myBtn2 {
display: none;
}
#play:checked ~ .controls #myBtn,
#pause:checked ~ .controls #myBtn2 {
display: block;
}
[name="player"] {
display: none;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div id="player">
<input type="radio" name="player" id="pause" checked>
<input type="radio" name="player" id="play">
<div class="controls">
<label id="myBtn2" for="play"><i class="fa fa-pause" aria-hidden="true"></i></label>
<label id="myBtn" for="pause"><i class="fa fa-play" aria-hidden="true"></i></label>
</div>
</div>
You want to assign the class
.carousel-control-next-icon
in the<label>
or in the<i>
?– Cmte Cardeal
@Cmtecardeal I want to assign the label id=myBtn2 Porq to i think it’s not right
– Java Iniciante