magento2 – Magento 2 trim checkout fields

To use your jQuery in Magento 2.x you can use below format jQuery code:

require(( 'jquery', 'jquery/ui'), function($){

      // put your code here if you want it in document.ready
      $(':input').change(function() { $(this).val($(this).val().trim()); });


       // Your code here
       console.log("bla bla");


 }, 2000);


Hope this will help you to achieve your requirements. Good Luck.

Ref: jQuery not working in checkout page – Magento 2