0
How to hide the answer
In this given code i just want to hide the answer https://code.sololearn.com/WYguMSY39PKf/?ref=app
5 odpowiedzi
+ 1
.spoiler-wrap {
display:none;
}
+ 1
visph hide inside the answer
And when clicked on it ....it must be displayed
+ 1
li:not(:hover) .spoiler-wrap {
display:none;
}
show answer on mouse over list element with only css
to hide/show on click you must use some js (or trickiest css hacks)
+ 1
// js solution:
onload = () => {
var spoil = document.querySelectorAll('.spoiler-wrap');
spoil.forEach(e => {
e.parentNode.onclick = _onclick.bind(e);
e.style.display = 'none';
});
function _onclick() {
this.style.display = this.style.display ? '' : 'none';
}
};
+ 1
css (trickiest) solution:
https://code.sololearn.com/WrXopDY90Q11/?ref=app