2

IEで機能しない動的テキストボックスの作成

       // Create a new text input
        var newText = document.createElement('input');
        newText.type = "input";

他のすべてのブラウザで動作しています

4

2 に答える 2

1

setAttribute メソッドを使用してこれを試してください。

また、'text' や 'submit' などの正しいタイプを設定してください。

        var newText = document.createElement('input');
        newText.setAttribute("type", "text");
于 2012-11-20T10:22:31.163 に答える
1

IE では、入力要素の型を「変更」できません。次のような回避策を使用する必要がありますdocument.createElement("<input type=\"text\" name=\"textBox\" >");

于 2012-11-20T10:24:47.020 に答える