Guys, my javascript is pretty dire, could do with a hand here please.
I have the following:
When I click the button I want it to copy the selected option in "available" and append it to the "active" list.
If possible I'd like it to copy multiple selected options. I have prototype available so if that's easier then i'll use it.
How do I detect if an option is selected using DOM?
I have the following:
- an "available" select list with x options
- an "active" select list with y options
- a button named "activate selected"
When I click the button I want it to copy the selected option in "available" and append it to the "active" list.
If possible I'd like it to copy multiple selected options. I have prototype available so if that's easier then i'll use it.
Code:
function addOptions() {
var availableNewsItems = $("avaiableNewsItems");
// loop here to see whats selected and add them to a temp array?
// loop through the temp array and insert into active select?
}
How do I detect if an option is selected using DOM?