JSFiddle - React, Tailwind, and code Playground
HTML
<a href="http://stackoverflow.com
/questions/
22831988/
string-attribute-values-in-multiple-lines-html">
LINK
</a>
JavaScript
var href = $('a').attr('href').replace(/ /g,'');
$('a').attr('href', href);