Hello,
I am having trouble using these methods. Can someone please help? here is my code and question:
First, does anyone know why the wrap method doesn't work with the child selector? the wrapInner is okay with this so I thought it was strange that this wasn't...
var add_li = document.createElement('li');
$('table.nestedLayoutTable > tr').wrap(add_li);
I also tried using the jquery children method:
$('table.nestedLayoutTable').children(add_li);
- and/or
$('table.nestedLayoutTable').children().addClass('survey_list');
The first scenario doesn't do anything unless I remove the '>' but then it adds the <li> tag to all <tr> tags which isn't what i want.
The 2nd scenario adds all <tr> tags to <li> tag - not just the immediate
descendants.
and the 3rd scenario doesn't do anything so I am not even sure if this can be done like this - adding methods together like this
Can anyone help? AGain,I just need to target the immediate descendants of this table.
thanks!