How to add new html attribute maxlength="10" to street input field on shipping address form.
Thanks
How to add new html attribute maxlength="10" to street input field on shipping address form.
Thanks
I achieved this with below code
require(['jquery', 'jquery/ui'], function($){ jQuery(document).ready( function() { var existConditionZero = setInterval(function() { if (jQuery("input[name='street[0]']").length > 0) { clearInterval(existConditionZero); runMyFunctionZero(); } }, 100); function runMyFunctionZero(){ jQuery('input[name="street[0]"]').attr("maxlength","10"); } }); }); require(['jquery', 'jquery/ui'], function($){ jQuery(document).ready( function() { var existConditionOne = setInterval(function() { if (jQuery("input[name='street[1]']").length > 0) { clearInterval(existConditionOne); runMyFunctionOne(); } }, 100); function runMyFunctionOne(){ jQuery('input[name="street[1]"]').attr("maxlength","10"); } }); });