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?
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?
- <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> – Asim Zaidi Commented Jun 8, 2010 at 22:44
- @user: Have a look at How do I format my code blocks?. – Marcel Korpel Commented Jun 8, 2010 at 22:47
-
Your CSS (within
style
attributes) is malformed: you have to use a unit identifier (e.g., px, em, etc.) when definingtop
,left
,height
andwidth
. Your HTML is malformed, too:<span>
elements can only contain inline elements.<div>
is a block-level element. See w3/TR/html401/struct/global.html#h-7.5.3 – Marcel Korpel Commented Jun 8, 2010 at 22:55
1 Answer
Reset to default 1document.all
is very old, see my answer to another question. Use document.getElementById
instead.
Example:
var theElement = document.getElementById("lblSelectedTests");
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744848616a4596991.html
评论列表(0条)