Let's say that I have a function defined in JQuery, I write it in a simplified way:
miFunc = function(elem) {
...
}
elem
is an HTML element. It could be a past element when making the call for some mouse event. For example, a div element with the onmouseover attribute, as in the following code.
<div class"unaClase" onmouseover="miFunc(this);">
<span class="otraClase"> ... </span>
</div>
Having elem
, how could I access the elements that have the class otraClase
and are within elem
? For example, for the code shown, select the element span
to modify its content.
Obviously I am looking for something dynamic and these examples are concrete cases. The elements might not be span and there could be several (or even none).