I have done it with eval but I read that eval is evil. So I am curious: how do I write this without eval()?. I already tried some sample but it didn't work. Is it possible to do this without eval or is eval the only way?
$(".test").each(function(){
var xyz = "";
var w = $(this).last().attr("name");
for(var i=0; i< (w-1);i++){
var xyz = xyz + ".prev()";
}
var x = '$(this).first().parent()' + xyz;
var y = x + '.find("td.one").attr("rowspan",'+w+');';
eval(y);
});