Tammu
asked on
How to pass to assign an variable value to an element
I have an element and I am trying to pass a variable value of another element. here is my code
In the above code I want to display option.prompt ( the value) in s1. So using createTextNode won't help as it will only display option.prompt but not its value. this is where I am stuck.
any advice or examples are appreciated
var links = document.createElement ('li');
var img = document.createElement( 'img');
img.src = option.image; // this gives the path of the image
img.alt = option.prompt;
links.appendChild( img );
var s1 = document.createElement('span');
In the above code I want to display option.prompt ( the value) in s1. So using createTextNode won't help as it will only display option.prompt but not its value. this is where I am stuck.
any advice or examples are appreciated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER