Created
July 10, 2017 13:20
-
-
Save bcostea/cc1ef4af74a881f4996d49d0919832e5 to your computer and use it in GitHub Desktop.
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Example of Bootstrap 3 Prepended and Appended Inputs</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
<style type="text/css"> | |
.bs-example{ | |
margin: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="bs-example"> | |
<form> | |
<div class="input-group"> | |
<input id="link_to_open" type="text" class="form-control" placeholder="Username"> | |
<span class="input-group-addon"> | |
<a onclick="openLink('link_to_open')"> <span class="glyphicon glyphicon-link"></span></a> | |
</span> | |
</div> | |
</form> | |
</div> | |
<script> | |
function openLink(link_input){ | |
window.open($("#"+link_input).val()); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment