Skip to content

Instantly share code, notes, and snippets.

@Pum-purum
Created December 3, 2019 12:25
Show Gist options
  • Save Pum-purum/92720e3dcec3a8956ae1d9d283991c5c to your computer and use it in GitHub Desktop.
Save Pum-purum/92720e3dcec3a8956ae1d9d283991c5c to your computer and use it in GitHub Desktop.
foreach in JS
for (value of this.IDS) {
$('#' + value).barrating({
theme: 'fontawesome-stars',
showSelectedRating: false,
initialRating: this,
onSelect: function (value, text, event){
var obj = this.$elem[0];
if (value == 5) {
var companyID = $(obj).data('companyid');
_this.allCorrect(value, companyID)
} else {
var companyName = $(obj).data('name');
_this.notAllCorrect(value, companyName, event);
}
},
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment