Get Dynamic Any Product Name Using JQuery


var productname = '', $form = '';
$(".cp-list-box").click(function(){
  //console.log('called ');
productname = $(this).find('.elementor-heading-title a').text();
//console.log(productname);
//$body.find('#product_inquiry').val('9898989');
//jQuery("#product_inquiry").val('11231213');
//$('input[name="product-inquiry"]').val('123');
});
/* Elementor Popup Box JQuery Code */

$( document ).on( 'elementor/popup/show' , function () { 
$('input[name="product-inquiry"]').val(productname);
$('#popup-product-name').html(productname);
//$form = $('.wpcf7-form').eq(0);
    
// register all the necessary events on the Contact Form 7 form
//wpcf7.initForm($form);
setTimeout( function() { 
        wpcf7.initForm( jQuery('.wpcf7-form') );
}, 800 ); 
} );