$.fn.updateFilter = function(filterType, paramVal) { // filter="DATE|GREATERTHANEQUALS|LESSTHANEQUALS|" // param="|01/01/1900|01/01/2100|" // dtype="|DATE|DATE try { var div = $('#PQ_ExpirationDate').parent('div'); var filter = div.attr('filter').split('|'); var param = div.attr('param').split('|'); var index = -1; for (var i = 0; i < filter.length; i++) { if (filter[i] == filterType) { index = i; break; } } if (index > -1) { param[index] = paramVal; param = param.join('|'); div.attr('param', param); } } catch (e) { console.log(e); }}