By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,718 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

removing a menu item

P: n/a
Hi,

If a have a SELECT MULTIPLE element, represented by the javascript
variable, "myMenu", how would I remove the third item from the list
(assume there are more than 5 options)?

Thanks, - Dave

Jul 19 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
la***********@zipmail.com said the following on 7/19/2006 12:18 PM:
Hi,

If a have a SELECT MULTIPLE element, represented by the javascript
variable, "myMenu", how would I remove the third item from the list
(assume there are more than 5 options)?
Assume? When is your homework assignment due?

The fact there are more than 5 options is irrelevant to the problem.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 19 '06 #2

P: n/a
You can use something like this function. Just pass the SELECT object
as first
argument and index to remove as second argument. Sorry for my bad
English.
/*******************************
This function is just for
ilustrate method ..
*******************************/
function myremoveItem(aSelectObj,aItemIndex)
{
if(aSelectObj.tagName != "SELECT")
return;
aSelectObj.remove(aItemIndex);
}
la***********@zipmail.com wrote:
Hi,

If a have a SELECT MULTIPLE element, represented by the javascript
variable, "myMenu", how would I remove the third item from the list
(assume there are more than 5 options)?

Thanks, - Dave
Jul 19 '06 #3

P: n/a
You can use something like this function. Just pass the SELECT object
as first
argument and index to remove as second argument. Sorry for my bad
English.
/*******************************
This function is just for
ilustrate method ..
*******************************/
function myremoveItem(aSelectObj,aItemIndex)
{
if(aSelectObj.tagName != "SELECT")
return;
aSelectObj.remove(aItemIndex);
}
la***********@zipmail.com wrote:
Hi,

If a have a SELECT MULTIPLE element, represented by the javascript
variable, "myMenu", how would I remove the third item from the list
(assume there are more than 5 options)?

Thanks, - Dave
Jul 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.