I am hoping that this enquiry will be a easy one for someone to help shed some light on... I know that in order to create a textarea in Drupal 8 the following code can be used (e.g. render array)
$the_textarea=array(
'#type' => 'textarea',
'#required' => FALSE,
'#ajax' => array (
// Function to call when event on form element triggered.
'callback' => array($this->componentCallbackObject,$this->componentCallbackFunction),
'event' => $this->componentEvent,
),
);
In the above code, a callback is defined using ajax ... this has the result of the code requiring the client to communicate with the server, which then sends back instructions to the client side using ajax... Is there away to get a component to execute some javascript (where the javascript would be loaded when the page in question, first loads) and when either the upkey, downkey or onchange event is triggered for the textarea the javascript, which would already be available to the client would be executed.
The main point here is that the client wouldn't need to communicate with the server, just with the javascript which is loaded when the page first loads e.g. without having to callback to the server and then wait for the server to send back the information.