i have this javascript var:
var mylist = '1,5,3,7,9,8,44,6';
I need to remove the 9, so that the final value is: 1,5,3,7,8,44,6
I usually do this server side with php (easy way). How can achieve this with javascript? A solution using jQuery would be even better.
considerations: it should work also if var is ‘99,9,96’ or ‘9’ or ‘99,9’ or ‘9,98’ …etc.
my_list = my_list.split(',').filter(function(e) { return e != 9}).join(',');Later edit: to support array.filter in IE: