hi there,how to make my button click and shows every single string on every clicking...
help me please
<!DOCTYPE html>
<html>
<body>
<p>Click the button to show the result.</p>
<button onclick="myFunction('Car','Bus','Aeroplane')">Select a transport types</button>
<p id="demo"></p>
<p id="demo1"></p>
<p id="demo2"></p>
<script>
function myFunction(carname,busname,planename)
{
var carname="Car";
document.getElementById("demo").innerHTML=carname;
{
var busname="Bus";
document.getElementById("demo1").innerHTML=busname;
{
var planename="Aeroplane";
document.getElementById("demo2").innerHTML=planename;
}
}
}
</script>
</body>
</html>