JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://www.parsecdn.com/js/parse-1.2.17.min.js"></script>
<select name="huge" class="btn-group select select-block mbl select-multiple" id="selectFriend">
<option value="0">Select a friend</option>
</select>
JavaScript
Parse.initialize("JlldH30crp1Q8UwcRSZEZ10c5A3MNh8Tlzt1STpm", "N5yS4yEKI5AnCPJIS9y2l41MNGb7JrxTOuNZOyIz");
var SportOrganization = Parse.Object.extend("SportOrganization");
var queryOne = new Parse.Query(SportOrganization);
queryOne.find({
success: function(results) {
var organizations = [];
for (var i = 0; i < results.length; i++) {
organizations.push({
organizationTitle: results[i].get('organizationTitle'),
});
var select = $("#selectFriend");
var added = {};
$.each(organizations, function(i, v) {
var opt = v.objectId
var optfrontend = v.organizationTitle;
if (!added[optfrontend]) {
added[optfrontend] = true;
var el = document.createElement("option");
el.textContent = optfrontend;
el.value = opt;
select.append(el);
}
});
}
},
error: function(error) {
alert("Error: " + error.code + " " + error.message);
}
});