The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> How can I add two Javascript on html?, Question
Alexf
post 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????
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 02:55 PM