Created
March 21, 2017 11:26
-
-
Save dursk/2c0a67ed7aca9d31b32acc3a4361347d to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=2c0a67ed7aca9d31b32acc3a4361347d
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(" "); | |
return split[0][0] + ". " + split[1][0] + "."; | |
} | |
$("#submit1").click(function(){ | |
var fullName = $("#pass1").val(); | |
$("#result1").html("Your initials are: " + getInitials(fullName)); | |
}); | |
$("#submit2").click(function(){ | |
var fullName = $("#pass2").val(); | |
$("#result2").html("Your friend's initials are: " + getInitials(fullName)); | |
}); | |
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