src/utils.js
function(element, content) {
    var nodeName = element.nodeName.toLowerCase(),
        type = element.hasAttribute('type') ? element.getAttribute('type') : null;

    if (nodeName === 'textarea') {
      return true;
    }
    if (nodeName === 'input' 
      && ['text', 'password', 'number', 'date'].indexOf(type) !== -1) {
      return true;
    }
    return false;
  }
function(element, content) {
    var nodeName = element.nodeName.toLowerCase(),
        type = element.hasAttribute('type') ? element.getAttribute('type') : null;

    if (nodeName === 'textarea') {
      return true;
    }
    if (nodeName === 'input' 
      && ['text', 'password', 'number', 'date'].indexOf(type) !== -1) {
      return true;
    }
    return false;
  }
function ( element , content ) { var nodeName = element . nodeName . toLowerCase ( ) , type = element . hasAttribute ( 'type' ) ? element . getAttribute ( 'type' ) : null ; if ( nodeName === 'textarea' ) { return true ; } if ( nodeName === 'input' && [ 'text' , 'password' , 'number' , 'date' ] . indexOf ( type ) !== - 1 ) { return true ; } return false ; }
Tell if the element can accept the given content
Tell if the element can accept the given content