0
votes

I am using wordpress plugin Product And Custom Post type Dropdown CF7 which allows us to show the products dropdown from Woocommerce. I want to add first option as 'select product'. How can I do that? Please help.

1

1 Answers

0
votes

Found the solution. It can be done as:

var data = {
    id: 1,
    text: 'Barn owl'
};

var newOption = new Option(data.text, data.id, false, false);
$('#mySelect2').append(newOption).trigger('change');