How to have custom ajax commands on element using InvokeCommand How can i use custom ajax command using #ajax api , i have the following code working well 

        $ajax_response = new AjaxResponse();                
        $ajax_response-&gt;addCommand(new InvokeCommand('#edit-event-trigger', 'attr', array('disabled',true)));
        $ajax_response-&gt;addCommand(new InvokeCommand('#edit-event-trigger', 'removeAttr', array('placeholder')));
        $ajax_response-&gt;addCommand(new InvokeCommand('#edit-event-trigger', 'css',array("background-color", "")));
        //Return the AjaxResponse Object.
        return $ajax_response;


But suppose if i want to focus() or hide() the edit-event-trigger element , how could i do that ?
These are some examples you can try:

$response-&gt;addCommand(new \Drupal\Core\Ajax\InvokeCommand('.message', 'addClass', array('show')));
$response-&gt;addCommand(new \Drupal\Core\Ajax\InvokeCommand('.message', 'removeClass', array('show')));
$response-&gt;addCommand(new \Drupal\Core\Ajax\InvokeCommand('.message', 'attr', array('value', '123')));
$response-&gt;addCommand(new \Drupal\Core\Ajax\HtmlCommand('.message', "Show this text"));
$response-&gt;addCommand(new \Drupal\Core\Ajax\InvokeCommand('.message', 'css', array('background', '#dff0d8')));


Peace.