Hopefully, the last problem for a while: the function below is supposed to select a span which is the child of a class and add some text to the span.
The html looks like this:
<p class="a1">some text<span></span></p>
The class is a variable... 'a1' 'a2' etc.
function addTxt(myline) {
$(myline > span).html(' more text ');
}
called with addTxt('.a1').
Firefox is giving the error message 'span is undefined'.
There may be a clue here: if it's changed to
$(p.myline > span).html(' more text ');
the error message changes to 'p is undefined'.
I could give the spans a class, but that would make the code heavier as there are hundreds of em.
Any ideas?