Export html table with dropdown lists to a CSV file using jquery/javascript
I found what was missing. I just needed the ".length" in my if condition.
if($(this).find('select').length){
line.push(_quote_text($(this).find('option:selected').text()));
}else{
line.push(_quote_text(_trim_text($(this).text())));
}