There is a wordpress website with the contact form 7 plugin installed. I add inside the form (it is in the pop-up window)
<input type="hidden" name="title-methodic" value="" class="wpcf7-form-control wpcf7-hidden hide-title" id="hide-title"> and this is what I noticed: if you access the hidden element via id , then the value in val is not recorded, and if in the class , it is recorded.
$(document).on('click', '#button', function() { title = $(this).attr('data-title'); $('.hide-title').val(title); //работает $('#hide-title').val(title); //не работает }); Why is this so? Feature jquery , contact form 7 , pop-up window or some other functional?