On a click I store a variable. I would like to then trim that variable for all whitespace. I am getting an error when I to simply console.log the new variable.
var songToTrim = $(this).html();
console.log(songToTrim);
var songToPlay = songToTrim.replace(/ /g,'');
console.log(songToPlay);
For bonus points if you can add how to make sure the variable is converted to all lowercase that would be huge. If not it'll still work. Thanks!