Elementals.js

Latest Version: 2.0 RC 3 14 March 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

Downloads

Advertisement