[jQuery] Is there anyway to grab the Children of an Element?
Hello,
I am trying to grab the child of element in my html (see below)
<th class="name" colspan="4">
<b class='add'> </b>
</th>
I am trying to use this Jquery Code to grab the "b" child element of
"th". I want to change the class element for b from "add" to
"subtraction"
var $selected = $(this).children("th.name");
console.log($selected); /* returns Object length=0 prevObject=Object
context=th.name */
console.log($selected.find("b").length); /* returns 0 */
When I try to select b, for obvious reasons the remove and add class
doesnt work
$selected.find("b").removeClass().addClass("subtraction");
Does anyone have a solution to this problem?
Regards
Martin Ikediashi