Create a dynamic select drop down box

D

daveyand

Hey guys,

I am currently stuck, i am trying to create a function that will create
a fresh new drop down option box dynamically.

What happens is the user can double click an element on the page, when
they do this function should be called and create the drop down.

I can do the innerHTML stuff, i know how to add new options but am
stuck as to how to create the initial object in the first place.

Any help would be much appreciated.

Cheers
 
O

Otto Lang

daveyand said:
Hey guys,

I am currently stuck, i am trying to create a function that will create
a fresh new drop down option box dynamically.

What happens is the user can double click an element on the page, when
they do this function should be called and create the drop down.

I can do the innerHTML stuff, i know how to add new options but am
stuck as to how to create the initial object in the first place.

I think you are looking for

var dropDown = document.createElement("select");
Any help would be much appreciated.

Cheers

HTH
../otto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top