diff --git a/site/index.js b/site/index.js index 7bdf29f..58c6abf 100644 --- a/site/index.js +++ b/site/index.js @@ -75,9 +75,9 @@ function getOptionsFromInputs() { var input = inputs[i]; var val = input.value; - if (hasClass(input, 'percent')) { + if (input.classList.contains('percent')) { val += '%'; - } else if (!hasClass(input, 'string')) { + } else if (!input.classList.contains('string')) { val = parseFloat(val); } @@ -113,11 +113,3 @@ function getParamStringFromOpts(opts) { return params.join('&'); } - -function hasClass(el, className) { - if (el.classList) { - return el.classList.contains(className); - } else { - return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className); - } -}