After many hours of frustration and trying with and without form tags and various other things discussed on this forum and on stack overflow, I can’t seem to get the return key to trigger the #getJSON call. I have used alert(“This is working”); at various points in my code and it seems to be breaking at the AJAX call. I built this originally locally with the JS console and there is no bug. The button works great. There is no AJAX error message either.
I’ve also googled this and can’t get advice I’ve found to work. According to the jQuery documentation, the #keyup should work fine with forms so I kept it in my HTML. I’m really stumped why this isn’t working. Any help is much appreciated!
Here is a link to the CodePen: http://codepen.io/testinnplayin/pen/LRNjwd
Edit - if I remove the form tags the entire thing breaks, even the button.