i have a code which is avaliable in the following fiddle
code is like this
<a data-rel="http://mydomain.domian.com?z_9.asp&rpttype=298&sotBy=2sortOrder=1&pagenum=2">
$(document).ready(function() {
var urlval = $("a").attr('data-rel');
alert(urlval);
});
i am trying to remove the &pagenum=2 from the url if it exists, if it does not exists, then no problem, if exists, i want to remove that
what should i try here