开发者

Replacing Class with variable

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 pleas开发者_JAVA百科e forgive me, Im still learning basics

Thanks


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();


try

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜