Browse Source

enter key support

pull/11/head
Bryce Murphy 5 years ago
parent
commit
14109a1e3e
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      public/FriendsGraph.html

+ 7
- 1
public/FriendsGraph.html View File

@ -57,7 +57,7 @@
<a class="navbar-brand">Create Graph</a>
<form class="form-inline">
<input class="form-control mr-sm-2" id='txtUsername' type="search" placeholder="GitHub Username" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" onclick='fetchUserInput()' type='button'>Look Up</button>
<button class="btn btn-outline-success my-2 my-sm-0" onclick='fetchUserInput(key)' type='button'>Look Up</button>
</form>
</nav>
</div>
@ -76,6 +76,12 @@
<script>
document.addEventListener("keydown", event => {
if (event.key === "Enter") {
fetchUserInput();
}
})
function fetchUserInput()
{
const inputedName = $("#txtUsername").val();

Loading…
Cancel
Save