All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ckeditor-4.3.2.samples.plugins.enterkey.enterkey.html Maven / Gradle / Ivy

There is a newer version: 0.10.3
Show newest version




	
	ENTER Key Configuration — CKEditor Sample
	
	
	
	
	
	


	

CKEditor Samples » ENTER Key Configuration

This sample shows how to configure the Enter and Shift+Enter keys to perform actions specified in the enterMode and shiftEnterMode parameters, respectively. You can choose from the following options:

  • ENTER_P – new <p> paragraphs are created;
  • ENTER_BR – lines are broken with <br> elements;
  • ENTER_DIV – new <div> blocks are created.

The sample code below shows how to configure CKEditor to create a <div> block when Enter key is pressed.

CKEDITOR.replace( 'textarea_id', {
	enterMode: CKEDITOR.ENTER_DIV
});

Note that textarea_id in the code above is the id attribute of the <textarea> element to be replaced.

When Enter is pressed:
When Shift+Enter is pressed:






© 2015 - 2024 Weber Informatics LLC | Privacy Policy