Elementals.js

Latest Version: 3.0 RC 1 17 July 2017

Method String.jsToCssName

Calling Convention:
String.jsToCssName()
Parameters:
None
Returns:
A string result where "camelCase" has been stripped, and hyphens added as appropriate to turn a JavaScript style property into its CSS equivalent. It also detects browser prefixes and prepends a hyphen when detected.

Example:

JavaScript
var jsName = "webkitBorderRadius";
console.log(jsName.jsToCssName());
Output
-webkit-border-radius

Elementals String Methods

Elementals Extensions

Polyfills

These link to the Mozilla Developer Network (MDN)

Key

  • Object
  • Method
  • "Constant" property

Downloads

Advertisement