This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: set the focus in the input field

#34696
Ernest MarcinkoErnest Marcinko
Keymaster

Hi!

Try this variation of the custom code instead:

add_action("wp_footer", "asp_custom_script_wp_footer");
function asp_custom_script_wp_footer() {
	?>
	<script>
	jQuery(function($){
		$('.promagnifier').on('click', function(){
			var _this = this;
			setTimeout(function() {
				if ( $(_this).closest('.asp_w').attr('asp-compact') == 'open' ) {
					$(_this).closest('.asp_w').find('input.orig').focus();
				}
			}, 500);
		});

	});
	</script>
	<?php
}