Autor Zpráva
Taps
Profil
vytvořil jsem select pomocí document.createElement('select'); ale nevím jak do něj vložit option mohl by mi někdo poradit.
Leo
Profil
Bud addOption nebo appendChild, Leo
Taps
Profil
Leo
mám to takto
		var td4 = document.createElement('td');

    var input = document.createElement('select');
    		input.id = 'select'+this.inputArr.length;
		input.name = 'kategorie[]';
		 
var y=document.createElement('option');



			td4.appendChild(y);	
		    td4.appendChild(input);

jak bych to mohl upravit aby se mi zobrazovala hodnota která je mezi value
nightfish
Profil
imho
var y=document.createElement('option');
y.appendChild(document.createTextNode("text optionu"));
td4.appendChild(y);
los
Profil *
select.options[i] = new Option(text, value);
Taps
Profil
nightfish
ten text se mi objeví mimo option
los
toto mi nefunguje
nightfish
Profil
Taps
ten text se mi objeví mimo option
var y=document.createElement('option');
y.appendChild(document.createTextNode("text optionu"));
input.appendChild(y); // tady jsi mel chybu, option musis appendovat selectu, ne TD
td4.appendChild(input);
Taps
Profil
nightfish
díky
Toto téma je uzamčeno. Odpověď nelze zaslat.

0