Issue
I have an input field that I need to open a new window after the value is entered and I hit enter. The way I have it right now is after the value is entered it goes to this url https://search.broward.org/texis/search/?pr=FLLComplete&query=' + e.target.value
in the same window.
<div class="input-group">
<i class="catalog-search-icon fa-regular fa-magnifying-glass active"></i>
<input type="search" placeholder="Search Airport" aria-label="Search" name="searchterms" title="Search" alt="Search" id="airportSearchInput" size="20">
</div>
$(document).ready(function() {
$('#airportSearchInput').on("keyup", function(e){
if(e.code === "Enter" || e.key === "Enter") {
window.location.href = 'https://search.broward.org/texis/search/?pr=FLLComplete&query=' + e.target.value;
}
});
});
Solution
You can use window.open(url)
to open your url in a new new tab
Answered By - Tharindu Dhanushka
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.