tags:

views:

39

answers:

2

Just a simple question,

Im trying to replace class with var, but obviously still something wrong in the string.

I'm doing this:

var C = $('.form')      

    $(" ' " + C + "' tr").remove();

and trying to achieve this:

$(".form tr").remove();

I know that might be simple question, but please forgive me, Im still learning basics

Thanks

+2  A: 

It is as easy as:

var C = $('.form') 
c.find('tr').remove();

but you might do this too (maybe slower in some cases)

var c = ".form";
$(c + ' tr').remove();
Ghommey
A: 

try

var C = ".form";
$(C + " tr").remove();
wiifm