Connecting Tech Pros Worldwide Forums | Help | Site Map

removing a menu item

laredotornado@zipmail.com
Guest
 
Posts: n/a
#1: Jul 19 '06
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


Randy Webb
Guest
 
Posts: n/a
#2: Jul 19 '06

re: removing a menu item


laredotornado@zipmail.com said the following on 7/19/2006 12:18 PM:
Quote:
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/
gonaumov@gmail.com
Guest
 
Posts: n/a
#3: Jul 19 '06

re: removing a menu item


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);
}


laredotornado@zipmail.com wrote:
Quote:
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
gonaumov@gmail.com
Guest
 
Posts: n/a
#4: Jul 19 '06

re: removing a menu item


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);
}


laredotornado@zipmail.com wrote:
Quote:
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
Closed Thread