IDs are supposed to be, by definition, unique.  They are there so that
scripting languages and CSS style rules can easily identify single
elements.  If your markup has more than one element with the same ID
in it, then your markup is broken.  If you have more than one element
that needs to have the same appearance or behaviour then they should
all be given the same class instead.

On Mar 2, 7:32 pm, Samant <[EMAIL PROTECTED]> wrote:
> hi,
>
> I have 2 questions here for the group..
>
> 1.  Does Jquery have native functions or lib or plugins to support
> conversion of  HTML Table data into XML string ( which can then be
> sent via AJAX to server for getting a respone)  ?
>
> 2.  If my html page has tables with same ID , how can i obtain a
> handle to all these tables. Eg.  there is html page with 3 tables  of
> which 2 tables have same id.
> Can i get a handle to these tables using  any method like
> alert($('#Instructions').length);
> This however give me length as 1 instead of 2 .
>
> I tried using (IE only solution)
> document.all('Instructions').length   which works fine , but this does
> not work if there is only 1 id . eg.
> alert(document.all('UserData').length);
>
> Any help is appreciated !!
>
> sample code
> -----------------------------
>
> <table id='Instructions' border="1" cellpadding="0" cellspacing="1" >
> <tbody>
>         <tr>
>                 <td style="text-align: left; width:25%;  vertical-align: top">
>                 Table 1
>                 </td>
>                 <td  style="text-align: left; vertical-align: top">
>                         <input name="enter" />
>
>                 </td>
>         </tr>
>
> </tbody>
> </table>
>
> <table id='Instructions' border="1" cellpadding="0" cellspacing="1" >
> <tbody>
>         <tr>
>                 <td style="text-align: left; width:25%;  vertical-align: top">
>                 Table 2
>                 </td>
>                 <td  style="text-align: left; vertical-align: top">
>                         <input name="enter" />
>
>                 </td>
>         </tr>
>
> </tbody>
> </table>
>
> <table id='UserData' border="1" cellpadding="0" cellspacing="1" >
> <tbody>
>         <tr>
>                 <td style="text-align: left; width:25%;  vertical-align: top">
>                 Table 3
>                 </td>
>                 <td  style="text-align: left; vertical-align: top">
>                         <input name="enter" />
>
>                 </td>
>         </tr>
>
> </tbody>
> </table>
>
> TIA for reading this

Reply via email to