contentable div - double break

im having div with contenteditable=true attribute.
when users enter data and click "enter" to break line it does double break:


this is me

this is me

instead of

this is me
this is me

to avoid this i made this solution:
<div class="input" tabindex="2" id="edit" onfocus="Clean()" contentEditable="true">
                                                                  Enter your message here

it was working OK until i decided to make default value for the content ("enter message here"),
and clean the text when the div get focus.
with this feture it makes double break again

any solutions?
Who is Participating?
searlasConnect With a Mentor Commented:
The 'double break' you refer to is a new paragraph.  i.e. hitting enter inserts <p>...</p>.  You can use CSS to change the margin/space above and below a <p> tag if you wish:
<style type="text/css">
P { margin-top: 0px; margin-bottom: 0px }
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.