strPropertyEvents=20 Aug 2014-New Activity 1, 21 Aug 2014-gfdbfjdb ,21 Aug 2014-anubhav, 24 ug 2014-hjdf
Basically In strPropertyEvents it is stored in the form of string but I want to split this string in such a manner that where there is a comma , it splits down there and the output is in a dropdown list as
<script type="text/javascript">
$('#hiddenActivityDate').val('@strPropertyEvents');
alert($('#hiddenActivityDate').val());
var strList = hiddenActivityDate.split(',');
console.log(strList);
$.each(strList,function(index,val){
$("#ProgramList").append('<option>'+val+'</option>');
});
</script>
But the code is not working. Could you please help me out what is the mistake either in fiddle or anywhere.