Liferay.Loader.define("frontend-js-web@4.0.60/liferay/util/form/get_form_element.es", ['module', 'exports', 'require', 'frontend-js-metal-web$metal'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = getFormElement;

    var _metal = require("frontend-js-metal-web$metal");

    /**
     * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
     * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
     */

    /**
     * Returns a DOM element or elements in a form.
     * @param {!Element} form The form DOM element
     * @param {!string} elementName The name of the DOM element
     * @return {Element|NodeList|null} The DOM element or elements in the form, with
     * the given name
     * @review
     */
    function getFormElement(form, elementName) {
      var formElement = null;

      if ((0, _metal.isDef)(form) && form.nodeName === 'FORM' && (0, _metal.isString)(elementName)) {
        var ns = form.dataset.fmNamespace || '';
        formElement = form.elements[ns + elementName] || null;
      }

      return formElement;
    }
    //# sourceMappingURL=get_form_element.es.js.map
  }
});
//# sourceMappingURL=get_form_element.es.js.map