Created
October 29, 2017 21:05
-
-
Save greeneggsandmushrooms/d11950002c5fa516e847574e6e9becd8 to your computer and use it in GitHub Desktop.
35 Bin // source http://jsbin.com/degivot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>35 Bin</title> | |
<style id="jsbin-css"> | |
p{ | |
color:red; | |
} | |
</style> | |
</head> | |
<body> | |
<p id="paragraphText">This is awesome </p> | |
<button onclick="changeTheText()">Change the text</button> | |
<input type="text" id="changeUserText"> | |
<script id="jsbin-javascript"> | |
var coolNumber = 3; | |
function changeTheText(){ | |
if (coolNumber == 1){ | |
var changeTextVariable = document.getElementById("changeUserText").value; | |
document.getElementById("paragraphText").innerHTML = changeTextVariable; | |
} | |
else if(coolNumber == 2){ | |
alert("pop"); | |
} | |
else if(coolNumber == 3){ | |
alert("awesome"); | |
} | |
else{ | |
var changeTextVariable1 = "Else statement fired"; | |
document.getElementById("paragraphText").innerHTML = changeTextVariable1; | |
} | |
} | |
</script> | |
<script id="jsbin-source-css" type="text/css">p{ | |
color:red; | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var coolNumber = 3; | |
function changeTheText(){ | |
if (coolNumber == 1){ | |
var changeTextVariable = document.getElementById("changeUserText").value; | |
document.getElementById("paragraphText").innerHTML = changeTextVariable; | |
} | |
else if(coolNumber == 2){ | |
alert("pop"); | |
} | |
else if(coolNumber == 3){ | |
alert("awesome"); | |
} | |
else{ | |
var changeTextVariable1 = "Else statement fired"; | |
document.getElementById("paragraphText").innerHTML = changeTextVariable1; | |
} | |
}</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p{ | |
color:red; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var coolNumber = 3; | |
function changeTheText(){ | |
if (coolNumber == 1){ | |
var changeTextVariable = document.getElementById("changeUserText").value; | |
document.getElementById("paragraphText").innerHTML = changeTextVariable; | |
} | |
else if(coolNumber == 2){ | |
alert("pop"); | |
} | |
else if(coolNumber == 3){ | |
alert("awesome"); | |
} | |
else{ | |
var changeTextVariable1 = "Else statement fired"; | |
document.getElementById("paragraphText").innerHTML = changeTextVariable1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment