How I can access a specific <span> via its parent <div> like below:
<div>
<!--parent div-->
<div>
<span>...</span>
<span>...</span>
</div>
<div>
<span>...</span>
<span>.. through parent div i can access this span ..</span>
</div>
<!--close parent div-->
</div>
Edited:
There is a variable suppose item..In this item variable there are two values shows i.e (item = name size)
I break this variable through jquery in to parts..ie.item[0]=name; item[1]=size;
Now I print the name in parent div span…and size in child div span through jquery…
<div>
<!--parent div-->
<span>...Print Name...</span>
<div>
<span>...</span>
<span>...</span>
</div>
<div>
<span>...</span>
<span>.. Print Size.. ..</span>
</div>
<!--close parent div-->
</div>
If you’re trying to select that particular span from the parent div you need something like this:
But it would be far easier to give your
<span>a class name, e.g.In that case, selecting it will be something like:
Example