beginner here, I’m trying to make a display with buttons that could display additional information. I went about attempting this by having the information be set to display: none; and then setting them to display: inline; by invoking functions with a button.
However, it seems my buttons are not able to invoke the needed functions since even after attempting to console log the functions, they don’t respond.
Here’s the code all braces ie. {{}} are anki tags:
<style>
.card {
font-family: Comic Sans MS; //Kid font
font-size: 20px;
text-align: center;
color: black;
background-color: white;
}
li {
text-align:left;
display:none;
}
button{
display:block;
width:28%;
padding:auto;
margin:auto;
}
.mono{
font-family:"Courier New";
font-size: 1.18em;
font-weight:bold;
width:50%;
margin: auto;
}
.etymology {
margin:auto;
margin: 0 0 1em 0;
display:none;
}
.info{
margin: 0 0 1em 0;
display:none;
}
</style>
{{FrontSide}} // all tags with braces are anki tags
<hr id=answer>
<h2>{{def}}</h2>
<button onlclick="synonyms()"> Common Syn.</button>
<ul>
<li>{{c1}}, </li><li>{{c2}}, </li><li>{{c3}}, </li><li>{{c4}}, </li><li>{{c5}}</li>
</ul>
<div class="mono">
<div class="smol_details">
<div class="etymology">{{etymology}}<br> "{{source_language}}"</div>
<button onlclick="etymology()">Language info </button>
<div class="info">{{usage_cat}} {{recognition}} {{book}} <br>{{commentary}}</div>
<button onlclick="data()"> data data</button>
</div>
</div>
<script>
function synonyms() {
document.querySelectorAll("li").style.display = "inline";
console.log("cliced");
}
function etymology() {
document.querySelectorAll(".etymology").style.display = "inline";
console.log("cliced");
}
function data() {
document.querySelectorAll(".info").style.display = "inline";
console.log("cliced");
}
</script>
I need to have the