Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Text

Status
Not open for further replies.

zzfive03

Programmer
Jun 11, 2001
267
Hello;

I would like to dynamicly load a portion of text with the value of a <select> option. If a user selects for instance &quot;Red Cars&quot; in the select, and presses the &quot;Submit&quot; button, I want the button to do an OnClick which will call a function which takes the select.value and assigns it to the text.

I know how to do everything, except the text part. How can I create a segment of text, from which I can add color, size, and change its contents client side?

Thanks in advance for any help with this.
Mark
 
do it by setting the innerHTML property of a html element......make your element on the page, something like

<span id=&quot;bidnit&quot;>Initial Content</span>

then this javascript in the select box:

onChange=&quot;document.all[&quot;bidnit&quot;].innerHTML = this.options[this.selectedIndex];&quot;

should work --------------------------------

jb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top