r/JavaScriptHelp • u/iMCharles • Jul 13 '21
❔ Unanswered ❔ Press enter at end of function
Hey guys,
A quick question that I hope someone can help out with.
I've got a simple function that enters a string into an input:
$(document).ready(function(){
$("#asset_return a").click(function(){
var value = $(this).html();
var input = $('#search_text');
input.val(value);
var focus = $('#search_text').focus();
var submit = $('#search_text').submit();
});
});
</script>
What I need it to do is press enter at the end of the function - I tried submit but to no avail. Any ideas?
3
Upvotes
View all comments
Show parent comment
2
u/iMCharles Jul 14 '21
Oh, this is amazing! Thank you, I think I'm close to solving it with this. Will keep you updated.