Created
March 21, 2017 11:31
-
-
Save dursk/c2fd76534697250faaa339a677b5127c to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=c2fd76534697250faaa339a677b5127c
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>This is easy page</title> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<script src="easy.js"></script> | |
<link rel="stylesheet" type="text/css" href="easy.css"> | |
</head> | |
<body> | |
<h1>Enter your full name</h1> | |
<input id="pass1" class="pass" placeholder=""> | |
<button id="submit1" class="submit">Submit</button> | |
<div id="result1" class="result"></div> | |
<h1>Enter your friend's full name</h1> | |
<input id="pass2" class="pass" placeholder=""> | |
<button id="submit2" class="submit">Submit</button> | |
<div id="result2" class="result"></div> | |
</body> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
</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
{"enabledLibraries":["jquery"]} |
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
function getInitials(fullName) { | |
var split = fullName.split(" "); | |
var initials = split[0][0] + ". " + split[1][0] + "."; | |
return initials; | |
} | |
// Replace the question marks with a call to getInitials | |
// so that the initials appear when clicking the submit button. | |
$("#submit1").click(function(){ | |
var fullName = $("#pass1").val(); | |
$("#result1").html("Your initials are: " + "????"); | |
}); | |
$("#submit2").click(function(){ | |
var fullName = $("#pass2").val(); | |
$("#result2").html("Your friend's initials are: " + "????"); | |
}); | |
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
body { | |
text-align: center; | |
font-family: cursive; | |
} | |
.submit { | |
font-size: 20px; | |
padding: 20px; | |
border-radius: 20px; | |
font-family: cursive; | |
} | |
p { | |
font-size: 18px; | |
color: purple; | |
} | |
.pass{ | |
width: 300px; | |
height: 40px; | |
font-size: 18px; | |
font-family: cursive; | |
} | |
.result{ | |
font-size: 30px; | |
color: blue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment