let cont_form = document.querySelector('.wpcf7-form'); let attr_form = document.createElement('onsubmit', 'yaCounterХХХХХХ.reachGoal("contact_submit"); return true;'); cont_form.setAttribute(attr_form);