I got bitten by this yesterday.

Appending selects anywhere fails. However, the contents of a select are
appended;

Here's the code that illustrates this:

function appendFail()
{
    var myDiv = $("<div></div>").appendTo("#myid");

    var sel = $("<select name=\"any_name\"></select>");
    sel.append("<option>1</option>").append("<option>2</option>");
    myDiv.append(sel);
}

Options get appended to myDiv without a <select>

Daemach wrote:
> It appears to fail on appending a select as well :/
>
> $('<select id="'+tfo[tbl].cols[ci].node+'"
> name="'+tfo[tbl].cols[ci].node+'"></select>').appendTo(tbl)
>
> fails the same way :/
>
>
>
> Karl Rudd wrote:
>   
>> Looks like it could be a bug.
>>
>> In the mean time use:
>>
>> var t = $("#myTable")[0];
>> t.innerHTML = "<colgroup></colgroup>" + t.innerHTML;
>>
>> Hmmm not sure this will work in IE.
>>
>> Karl Rudd
>>
>> On 3/14/07, Daemach <[EMAIL PROTECTED]> wrote:
>>     
>>> I'm not having any luck with the following 2 commands - is this a bug or
>>> something I'm missing?  I've tried with <colgroup /> as well.
>>>
>>> $("#myTable").append("<colgroup></colgroup>");
>>>
>>> $("<colgroup></colgroup>").appendTo("#myTable");
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Append-bug--tf3400052.html#a9468060
>>> Sent from the JQuery mailing list archive at Nabble.com.
>>>
>>>
>>> _______________________________________________
>>> jQuery mailing list
>>> discuss@jquery.com
>>> http://jquery.com/discuss/
>>>
>>>       
>> _______________________________________________
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>>
>>
>>     
>
>   

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to