When you have a selection with values difference but you want show with other name.
Following is the way to show values with other label
var value_will_change = ['value 1','value 2','value 3','value n'];
value_will_change.forEach(function(item) {
$("select[name ='select_name'] option[value='" + item + "']").text('Text will change to');
});
explain:
- value_will_change: is array of option will show with other label.
Comments
Post a Comment