How to load a form/page into a div via AJAX? I want to open the create user form (/admin/people/create) into a specific div via AJAX. I can currently open such forms into a modal window using the following link format:
&lt;a href=&quot;/admin/people/create&quot; class=&quot;use-ajax&quot; data-dialog-type=&quot;modal&quot;&gt;
    Add user
&lt;/a&gt;

Is there any way to load this form/page into a div instead of into a modal window?
Core does not provide an HTML format for non-dialogs, but you can create your own custom format.
mymodule/js/custom-ajax-loader.js:
(function ($, Drupal) {
  Drupal.behaviors.myCustomAJAXStuff = {
    attach: function (context, settings) {
      $(&quot;a.use-custom-ajax&quot;, context).once('mymodule-ajax').each(function(i, ajaxLink) {
        const $linkElement = $(ajaxLink);

        const elementSettings = {
          url: $linkElement.attr(&quot;href&quot;),
          event: 'click',
          progress: {type: 'throbber'},
          element: ajaxLink,
        };

        const myAjaxObject = Drupal.ajax(elementSettings);

        // Declare a new Ajax command specifically for this Ajax object.
        myAjaxObject.commands.insert = function (ajax, response) {
          let target = $linkElement.attr(&quot;target&quot;);
          $(target).html(response.data);
        };
      });
    },
  };
})(jQuery, Drupal);

mymodule.libraries.yml:
mymodule.ajax:
  js:
    js/custom-ajax-loader.js: { }
  dependencies:
    - core/drupal.ajax

Add the library wherever needed: Adding stylesheets (CSS) and JavaScript (JS) to a Drupal module
Then when you create your link
&lt;a href=&quot;/admin/people/create&quot; class=&quot;use-custom-ajax&quot; target=&quot;#some-div-id&quot;&gt;
    Add user
&lt;/a&gt;