underscore :: String

underscore() -> string Converts a camelized string into a series of words separated by an underscore ("_").

Example

'borderBottomWidth'.underscore();

// -> 'border_bottom_width'

Note

Used in conjunction with dasherize(), underscore() converts a DOM style into its CSS equivalent.

'borderBottomWidth'.underscore().dasherize();

// -> 'border-bottom-width'

Prototype API 1.5.0 - prototypejs.org