MCPcopy
hub / github.com/autoNumeric/autoNumeric / _getDefaultValue

Method _getDefaultValue

src/AutoNumeric.js:6305–6315  ·  view source on GitHub ↗

* Get the default value from the html `value` attribute. * Return the empty string if such attribute is not found. * * @param {HTMLElement} domElement * * @returns {string} * @private

(domElement)

Source from the content-addressed store, hash-verified

6303 * @private
6304 */
6305 _getDefaultValue(domElement) {
6306 // Get the default html value
6307 // Note: we do not use the simpler `return domElement.defaultValue;` code since the given domElement can sometime be a `contenteditable` element which does not support the `defaultValue` attribute.
6308 const value = domElement.getAttribute('value');
6309
6310 if (AutoNumericHelper.isNull(value)) {
6311 return '';
6312 }
6313
6314 return value;
6315 }
6316
6317 /**
6318 * Handler for 'focusin' and 'mouseenter' events

Callers 1

_onFormResetMethod · 0.95

Calls 1

isNullMethod · 0.80

Tested by

no test coverage detected