By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,767 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,767 IT Pros & Developers. It's quick & easy.

DIV encompassing TD

P: n/a
Can anyone tell me how I can make the following work...

<table>
<div id="1">
<tr><td>testing</td></tr>
</div>

<input type="button" value="test" onClick="javascipt:removeQuestion('1','1')">
</table>

The Javascript will not recognize the div because it is wrapped in TR and TD.
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Els
Falc2199 wrote:
Can anyone tell me how I can make the following work...

<table>
<div id="1">
<tr><td>testing</td></tr>
</div>

<input type="button" value="test" onClick="javascipt:removeQuestion('1','1')">
</table>

The Javascript will not recognize the div because it is wrapped in TR and TD.


No, the div isn't wrapped in TR and TD.
You wrapped the TR and TD in the div.
I have absolutely now idea what you are trying to do here,
but I do know that correct markup would be putting the div
inside the td. You can't put anything between the table and
its rows.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

Jul 20 '05 #2

P: n/a
Je*******@aol.com (Falc2199) skrev :
<table>
<div id="1">
<tr><td>testing</td></tr>
</div>

<input type="button" value="test" onClick="javascipt:removeQuestion('1','1')">
</table>

The Javascript will not recognize the div because it is wrapped in TR and TD.


You can't have a <div> or a input between <table> and <tr>, try
it in the <td>.

<table>
<tr>
<td>
<div id="1">testing</div>
<div><input type="button" value="test"</div>
onClick="javascipt:removeQuestion('1','1')">
</td>
</tr>
<table
--
Knud
Jul 20 '05 #3

P: n/a
Falc2199 wrote:
Can anyone tell me how I can make the following work...

<table>
<div id="1">
<tr><td>testing</td></tr>
</div>
<input type="button" value="test"
onClick="javascipt:removeQuestion('1','1')"> </table>


Use the validator and get your HTML straight before worrying about the
JavaScript.

http://validator.w3.org/

(1) <table> can directly contain ONLY <tbody>, <thead>, <tfoot>, or <tr> NOT
<div> or <input>
(2) Ids of elements MUST begin with a LETTER.

It would also help to know what you are trying to do, <div> elements are not
magic, its possible that you could script the row itself (depending on what
you are trying to do).

You seem to have chosen an odd forum for this question -
comp.lang.javascript would seen more suited to it (although the problem
itself (your HTML isn't HTML) is better directed to
comp.infosystems.www.authoring.html.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.