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();
精彩评论