In magento 2 (checkout) I need to hide and show some fields.
<div class="field" data-bind="visible: visible, attr: {'name': element.dataScope}, css: additionalClasses" name="shippingAddress.custom_attributes.codice_fiscale">
<style>
.nascondi {
display:none;
}
</style>
<script type="text/javascript">
require(['jquery'], function($){
$(document).ready(function(){
$('div[name="shippingAddress.custom_attributes.codice_fiscale"]').addClass('nascondi');
alert("test di lettura jquery");
});
});
</script>
But not work. Alert function work (there is not an error) but the field div[name="shippingAddress.custom_attributes.codice_fiscale"] still visible.
Why? where is the error?
Thanks