P
Paul Blay
Unfortunately what javascript I did know I've mostly forgotten.
Basically I have something like this
<p>[first half of sentence]
<ruby>
<rb>
<span name="k_1123" id="k_1123" style="display:none">[answer]</span>
<span style='display:inline' id="s_1123" name="s_1123">XXXX</span>
</rb>
<rp>(</rp>
<rt>[hint]</rt>
<rp>)</rp>
</ruby>[second half of sentence]<br/>
<input type=button value="Check!" name="b_1123" onclick=
"document.getElementsByName('k_1123').style.display='inline';document.getElementsByName
('s_1123').style.display='none';"/>
</p>
On clicking the 'Check!' button I want the 'XXXX' hidden and the '[answer]' shown.
Except that what I get is
'Error: document.getElementsByName("k_1123").style has no properties'
Which I assume means I'm doing something stupid.
I've tried various things out and looked through a fair number of web-pages
but I'm officially giving up and asking for a pointer in the right direction.
Basically I have something like this
<p>[first half of sentence]
<ruby>
<rb>
<span name="k_1123" id="k_1123" style="display:none">[answer]</span>
<span style='display:inline' id="s_1123" name="s_1123">XXXX</span>
</rb>
<rp>(</rp>
<rt>[hint]</rt>
<rp>)</rp>
</ruby>[second half of sentence]<br/>
<input type=button value="Check!" name="b_1123" onclick=
"document.getElementsByName('k_1123').style.display='inline';document.getElementsByName
('s_1123').style.display='none';"/>
</p>
On clicking the 'Check!' button I want the 'XXXX' hidden and the '[answer]' shown.
Except that what I get is
'Error: document.getElementsByName("k_1123").style has no properties'
Which I assume means I'm doing something stupid.
I've tried various things out and looked through a fair number of web-pages
but I'm officially giving up and asking for a pointer in the right direction.