ReferenceError: $elem is not defined

Fixed, `ReferenceError: $elem is not defined`, and added radix parameter to `parseInt()` for JS linters.