Kristabs Posted November 23, 2006 Report Share Posted November 23, 2006 Hello! Piemērs: <select name="test" onChange="func(this.value)"> <option value="1">Viens</option> <option value="2">Divi</option> </select> Šajā gadījumā tiek padota vērtība "1", bet kā var padot kā funkcijas otro mainīgo tieši tekstu "Viens"? Link to comment Share on other sites More sharing options...
andrisp Posted November 23, 2006 Report Share Posted November 23, 2006 Padot nevar, bet ar JS vari nolasīt ieselektētā taga option innerHTML vai childNode[0] Link to comment Share on other sites More sharing options...
v3rb0 Posted November 23, 2006 Report Share Posted November 23, 2006 imo var gan padot. func(this.value, this.options[this.selectedIndex].text) Link to comment Share on other sites More sharing options...
Kristabs Posted November 23, 2006 Author Report Share Posted November 23, 2006 yes, v3rbo variants strādā kā nākas, paldies. Link to comment Share on other sites More sharing options...
Recommended Posts