0

I have a span like this:

<span id="selectedTests" class="emrFG">  
  <span id="lblSelectedTests" class="emrHDR" style="top:3;left:6;font-size:8pt;">Selections</span>  
  <span class="emrHDR" style="top:3;left:190;font-size:8pt;">Tests</span>  
  <div id="recordSet" style="top:19;height:112;width:444;"></div>
</span>

The span shows some rows of data and I want to call those rows individually by using document.all method.
How would I do that?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Asim Zaidi
  • 27,016
  • 49
  • 132
  • 221
  • Selections Tests
    – Asim Zaidi Jun 08 '10 at 22:44
  • @user: Have a look at [How do I format my code blocks?](http://meta.stackexchange.com/questions/22186/how-do-i-format-my-code-blocks). – Marcel Korpel Jun 08 '10 at 22:47
  • Your CSS (within `style` attributes) is malformed: you have to use a [unit identifier (e.g., px, em, etc.)](http://www.w3.org/TR/CSS21/syndata.html#value-def-length) when defining `top`, `left`, `height` and `width`. Your HTML is malformed, too: `` elements can only contain inline elements. `
    ` is a block-level element. See http://www.w3.org/TR/html401/struct/global.html#h-7.5.3
    – Marcel Korpel Jun 08 '10 at 22:55

1 Answers1

1

document.all is very old, see my answer to another question. Use document.getElementById instead.

Example:

var theElement = document.getElementById("lblSelectedTests");
Community
  • 1
  • 1
Marcel Korpel
  • 21,536
  • 6
  • 60
  • 80