0
I have a javascript file with this code:
const newTopic = document.getElementById('topic');
const introduction = document.getElementById('introduction');
function hidden(){
if(introduction.classList.contains("hidde")){
introduction.classList.add('hidde');
introduction.classList.remove('discussions-introduction');
newTopic.classList.remove('hidde');
}
}
and in my html you have this button here:
<button id="btn" onclick="hidden()">criar tópico</button>
but when I use this function it does not work, and the console returns me this error:
index.html:150 Uncaught TypeError: hidden is not a function
at HTMLButtonElement.onclick
javascript is being called here:
<script src="./js/newTopic.js"></script>
what may be going wrong?