Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
671 B
4
Indexable
Never
<button class="showhidebutton" onclick="showhidefunction(this)">Click to Show Solution</button>
<style>
 .showhidebutton {
 background: #ffffff !important;
 font-weight: 600;
 font-size: 15px;
 color: green;
 } 
 .showhidebutton:hover {
 text-decoration: none;
 color: green;
 }
 #solutionhide {
 display:none;
 } 
 .solutionshow {
 display:block !important;
 }
</style>
<script>
function showhidefunction(button) {
 var element = document.getElementById("solutionhide");
 element.classList.toggle("solutionshow");
 button.textContent = element.classList.contains("solutionshow") ? "Click to Hide Solution" : "Click to Show Solution";
}
</script>
Leave a Comment