JavaScript help

Fullmetal Chocobo

Moderator<br>Distributed Computing
Moderator
May 13, 2003
13,704
7
81
In the attached code, I'm trying to insert a string variable as the data in a value in a select / option form. I have code that copies what is put in the value to a drop down box selection to the clipboard, and I can't figure out a way to get the value of the string to the clipboard...
 

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
Put the test_string in a function that returns the string, and call it from value

<option value=function()>
 

Fullmetal Chocobo

Moderator<br>Distributed Computing
Moderator
May 13, 2003
13,704
7
81
It just returns "function()" then. I tried that, but tried it again just now to make sure.
 

Snapster

Diamond Member
Oct 14, 2001
3,916
0
0
The only way I can currently think of in JS would be to change the value of that item after the page loads, ie an initialisation. Or build the list in JS from scratch on page load.