I have a html page, inside which i have following code snippet, depending on which case we're following:
CASE 1) <p> <span id ="xyz"> some code here </span> </p>
CASE 2) <p> <span id ="xyz"> </span> some code here </p>
Now in my javascript code I have to write values in span xyz
dynamically. If I try to do get reference to span xyz
by id and then try to alter its innerHTML, then the html already present in span xyz
is lost.
If I keep extra code outside the span, it appears on new line due to some css effects. I cannot alter css due to some reasons.