I have a SP List with data that I need to be in a dropdown list. I also need these to have specific classes.
I'm trying something like the following but having no luck:
$().SPServices({
operation: "GetListItems",
async: false,
listName: "High_Risk_Countries",
completefunc: function (xData, Status) {
if(Status == 'success' )
{
$(xData.responseXML).SPFilterNode("z:row").each(function() {
//var value= $(this).attr("Title");
var text = $(this).attr("highriskCountries")
$("select[title='country1']").append($('<option></option>').val(text).html(text));
});
}
}
});
With the following HTML:
<select id="country1" title="country1"/>