I know this is going to be really basic, as I can appreciate how simple this should be - but I've got myself all twisted up.
I'm just trying to make a searchbar function. This is the input -
<input class="form-control me-2 header__searchbar comic__search" type="search" placeholder="Search" aria-label="Search" style="width: 15rem; margin-left: 2rem;">
This is the code (so far), but I cant get it to return the value.
var searchbar = $(".comic__search");
var searchBarVal = ""
$("body").on("keyup", searchbar, function() {
searchBarVal = searchbar.value;
console.log(searchbar.value);
})
Thanks all