How can I add two Javascript on html?, Question |
How can I add two Javascript on html?, Question |
Alexf |
Aug 2 2020, 12:42 PM
Post
#1
|
Group: Members Posts: 2 Joined: 2-August 20 Member No.: 27,470 |
Hey guys, I wanted to create a html that shows the translation and hides the translation. The first one was working but when I copied the first one and created another one, the first one didn't work, just the second one. This is the html:
<script type="text/javascript"> function ShowHideDiv(btnPassport) { var dvPassport = document.getElementById("dvPassport"); dvPassport.style.display = btnPassport.value == "Show Translation" ? "block" : "none"; } </script> <span>Translation</span> <input type="button" value="Show Translation" onclick="ShowHideDiv(this)" /> <input type="button" value="Hide Translation" onclick="ShowHideDiv(this)" /> <div id="dvPassport" style="display: none"> Olá tudo bem? Como vocês estão? My question is how can I make them work when I add another one or more than two???? |
Lo-Fi Version | Time is now: 27th April 2024 - 02:55 PM |