views:

87

answers:

2

Basically I have 3 drop down lists for security questions. I have java script setup that will spring an alert when the box is changed. I need to know how to add/remove or show/hide an option. like if the first box selected option 1....remove option one from the other 2 drop downs as possible selections.

A: 

You can use .detach() and .append() to delete or create <option> elements.

var old_options = $('select').find('options:gt(2)').detach(); // remove some options

$('select').append(old_options); // append saved option elements

You can also use, prepend() or appendTo() of course.

jAndy
A: 
$('selector').append($('select options:gt(n)').detach()); 
volkan er