Cannot Clear Search Results when entering new search

Im developing a web app that searches lyrics using Music Match Api but im having trouble clearing the div that produces the results when im doing another search. can someone please help me

heres the script

var results = '';


//get the artist name and tghe track name
var artistName = $('#searchArtistName').val();
var songName = $('#searchTrackName').val();


function makeRequest(artistName,songName){




//get the response and then append it to the card
var message = response.message.body.lyrics.lyrics_body;


results += `

<div class="col-md-8">
<div class="card card-custom bg-white border-white z-depth-5" id = "myCard">
<div class="card-body" style="overflow-y: auto">
<i class = "fa fa-book fa-2x text-center"></i>
<h6 class="card-title" style = "font-size:22px;font-family:Comic Sans MS">Album <br>${message}</h6>
<div class="card-footer" style="background: inherit; border-color: inherit;">




function clearResults(){




heres a snippet of the html file which has two input fields one for artist name and the other for the song name and a button for submission

<div class = “container”>
<h4>Search to view lyrics</h4>
<input type = “text” id = “searchArtistName” style=“margin-top: 20px;” class = “form-control” placeholder=“Enter Artist Name”>
<input type = “text” id = “searchTrackName” style=“margin-top: 20px;” class = “form-control” placeholder=“Enter Track Name”>
<button type = “submit” class = “btn btn-info btn-lg” id = “submitButton”>Search</button>
<div class = “container”>
<div id = “shower” class = “row”></div>

#jquery #ajax

7 Likes1.95 GEEK