1
0
mirror of synced 2024-11-21 20:46:07 +03:00

Merge pull request #7 from anhphamt/patch-1

Update docs.md
This commit is contained in:
Alex Weissman 2017-10-24 18:15:28 -04:00 committed by GitHub
commit d9703c4d1d

View File

@ -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');
}