Over a million developers have joined DZone.

Behave.js - A JavaScript Library To Add IDE-Style Behavior To HTML Text Areas

· Web Dev Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

 

Behave.js is a lightweight JavaScript library which allows you to augment plain HTML text areas to have IDE-like behavior.

Behave.js includes several features as listed below:

  • Replace Tab – Pressing the tab key will insert a tab character in the text area instead of cycling through control on the page.
  • Soft Tabs – Instead of using the tab character to denote tabs, spaces are used instead, with the ability to set the soft tabs size.
  • Auto Open - Behave.js automatically inserts closing counterpart characters for ( { [ “ and .
  • Overwrite Closing Characters – If you type a closing character immediately preceding the same character, one of the duplicate characters is deleted.
  • Auto Strip – If the cursor is placed between two paired characters, pressing backspace to delete the first character results in both characters to be deleted.
  • Auto Indent – Using this option allows Behave.js to auto indent your code.

Naturally, all of the above options are optional and can be activated and  deactivated as required.

Requirements: None
Demo: http:/ / jakiestfu. github. com/ Behave. js/
License: MIT License

The Web Dev Zone is brought to you by Stormpath—offering a complete, pre-built User Management API for building web and mobile applications, and APIs. Download our new whitepaper: "Build Versus Buy: Customer Identity Management for Web and Mobile Applications".

Topics:

Published at DZone with permission of Hirvesh Munogee , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}