Rename Form Block text

To rename Form Block text in Squarespace.

Use this code to Page Header Code Injection to rename: Country, Address Line 1, Address Line 2, City, Strate, Zip Code, required.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
window.addEventListener("load", (event) => {
    $(".caption-text").html(function() { 
          return $(this).html().replace("Country", "País");  
    });
    $(".caption-text").html(function() { 
          return $(this).html().replace("Address Line 1", "Línea de Dirección 1");  
    });
    $(".caption-text").html(function() { 
          return $(this).html().replace("Address Line 2", "Línea de Dirección 2");  
    });
     $(".required").html(function() { 
          return $(this).html().replace("required", "Requerido");  
    });
     $(".caption-text").html(function() { 
          return $(this).html().replace("City", "Ciudad");  
    });
     $(".caption-text").html(function() { 
          return $(this).html().replace("State", "Estado");  
    });
    $(".caption-text").html(function() { 
          return $(this).html().replace("ZIP Code", "Código Postal");  
    });
});
</script>

Result: