Having Issue on Passing Variable into HTML Class Tag

Right, that’s because “get_the_term_list” returns an html string of tags… Those won’t work well as class attributes! : )

I suspect what you want is wp_get_post_terms instead:

$terms = wp_get_post_terms( get_the_ID(), 'type', array('fields' => 'slugs') ); // array of term slugs
echo '<div class="element-item'.implode(' ', $terms).'">';

Hope this helps!