Why ajax form submit stop working after set form submit #id? My question is related to https://drupal.stackexchange.com/questions/98501/why-ajax-form-doesnt-work-after-paging-by-views-infinite-scroll

I try to do workaround by setting my own submit button id. 

   $form['mymodule_submit'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; $value,
      '#ajax' =&gt; array(
        'callback' =&gt; 'mymodule_like_form_ajax',
      ),
      '#attributes' =&gt; array(
        'class' =&gt; array($class),
        'id' =&gt; 'mymodule-like-form-' . $node-&gt;nid),
      )
   );


But in this case ajax submit doesn't work at all...
What am I doing wrong here?
JS recognizes things by ID. But Drupal's AJAX only knows Drupal-generated ID. That's why when you change ID manually, it tries to attach click listeners to DOM nodes with IDs that are not there.

If you change ID to some custom value, you must also provide custom JS to attach all .on to the objects with new ID.