0
Why doesn't this code work?
I have trie d to do a conversation game. I have tried to use a function that makes div elements visible in order to have content appear one by one , when a certain button is pressed. This worked one time but whe n i tried to use it again it didn't work This is the code: https://code.sololearn.com/WQvXKiP01qR0/#html What is wrong with it?
3 Answers
+ 1
Hello,
This is your code:
<div id="myDIV" style=" visibility : hidden;">hello there <br>
<button>hello</button onclick="hel()" type="submit">
<button onclick="noCommm()">...</button>
</div>
Clearly, you've placed attribute onclick="hel()" in closing button tag. Update onclick="noCommm()" to onclick="hel()" and the code will work.
+ 1
Here I've corrected and beautified code a lil bit:
https://code.sololearn.com/WIs11XciFZao/?ref=app
+ 1
Thank you a lot for your help! I was focusing on the functions and didn't see that I had misplaced it.