I want to convert following html code into continuous string using jquery/javascript.
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
This is the html placed inside the textarea(with id “description”) when I read these contains using $('#description').text(), I get this description as
one
two
three
instead I would like to get it as “one two three” i.e. continuous, any suggestion?
You need to remove line breaks.
Or replace them with spaces:
—
http://www.textfixer.com/tutorials/javascript-line-breaks.php