Javascript-форум (https://javascript.ru/forum/)
-   (X)HTML/CSS (https://javascript.ru/forum/xhtml-html-css/)
-   -   Помогите доработать JS (https://javascript.ru/forum/xhtml-html-css/6410-pomogite-dorabotat-js.html)

Dotoni 26.11.2009 19:23

Помогите доработать JS
 
Вот этот js
var textdisplay=new Array()
textdisplay[0]="ТЕКСТ"
textdisplay[1]="ТЕКСТ"
textdisplay[2]="ТЕКСТ"
textdisplay[3]="ТЕКСТ"
textdisplay[4]="ТЕКСТ"

function displaydesc(which){
if (document.all)
descriptions.innerHTML=textdisplay[which]
else if (document.getElementById)
document.getElementById("descriptions").innerHTML=textdisplay[which]
}

displaydesc(document.a294.a969.selectedIndex)

document.a294.a969.options[0].selected=true

Дело в том что я хочу чтобы вместо "ТЕКСТ" можно было писать любой html код, а не только текст.
Помогите мне! :help:

B~Vladi 26.11.2009 20:34

Скрипт позволяет это делать.

Dotoni 26.11.2009 20:39

А код в ковычках писать?

B~Vladi 26.11.2009 20:53

Конечно. Я так подозреваю, ты не знаком со свойством innerHTML?

Gvozd 26.11.2009 20:59

одной пары внешних кавычек достаточно
Но, если элемент в который вы пытаетесь поместить HTML-код этого не позволяет, то ничего у вас не получится


Часовой пояс GMT +3, время: 20:17.