diff --git a/pages/12.programmatic-control/01.add-select-clear-items/docs.md b/pages/12.programmatic-control/01.add-select-clear-items/docs.md index b3f3443c..362c9fee 100644 --- a/pages/12.programmatic-control/01.add-select-clear-items/docs.md +++ b/pages/12.programmatic-control/01.add-select-clear-items/docs.md @@ -16,7 +16,7 @@ var data = { text: 'Barn owl' }; -var newOption = new Option(data.name, data.id, false, false); +var newOption = new Option(data.text, data.id, false, false); $('#mySelect2').append(newOption).trigger('change'); ``` @@ -32,7 +32,7 @@ if ($('#mySelect2').find("option[value='" + data.id + "']").length) { $('#mySelect2').val(data.id).trigger('change'); } else { // Create a DOM Option and pre-select by default - var newOption = new Option(data.name, data.id, true, true); + var newOption = new Option(data.text, data.id, true, true); // Append it to the select $('#mySelect2').append(newOption).trigger('change'); }