0

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 Answers 2

2

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();
Sign up to request clarification or add additional context in comments.

Comments

0

try

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.