Days
Hours
Minutes
Seconds
x

Froala Editor v4.2.0 is Here LEARN MORE

Skip to content

Typing

ENTER Key

The way ENTER key behaves can be customized using the enter option. There are 3 possible options:

Try it yourself:




Edit in JSFiddle

HTML

<div id="froala-editor-p">
  By default the editor is using <code>P</code> tags. When ENTER key is hit, a new <code>P</code> tag is created.
</div>
<br/>
<div id="froala-editor-div">
  The editor can use <code>DIV</code> tags. When ENTER key is hit, a new <code>DIV</code> tag is created.
</div>
<br/>
<div id="froala-editor-br">
  The editor can use <code>BR</code> tags. When ENTER key is hit, a <code>BR</code> tag is inserted.
</div>

JAVASCRIPT

<script>
  new FroalaEditor('div#froala-editor-p');

  new FroalaEditor('div#froala-editor-div', {
    enter: FroalaEditor.ENTER_DIV
  });

  new FroalaEditor('div#froala-editor-br', {
    enter: FroalaEditor.ENTER_BR
  });
</script>