answersLogoWhite

0


Best Answer

<HTML xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/HTML; charset=iso-8859-1" />

<title>Interchange/Swap List Items</title>

<script type="text/javaScript">

function moveToRightOrLeft(side){

var listLeft=document.getElementById('selectLeft');

var listRight=document.getElementById('selectRight');

if(side==1){

if(listLeft.options.length==0){

alert('You have already moved all countries to Right');

return false;

}else{

var selectedCountry=listLeft.options.selectedIndex;

move(listRight,listLeft.options[selectedCountry].value,listLeft.options[selectedCountry].text);

listLeft.remove(selectedCountry);

if(listLeft.options.length>0){

listLeft.options[0].selected=true;

}

}

}else if(side==2){

if(listRight.options.length==0){

alert('You have already moved all countries to Left');

return false;

}else{

var selectedCountry=listRight.options.selectedIndex;

move(listLeft,listRight.options[selectedCountry].value,listRight.options[selectedCountry].text);

listRight.remove(selectedCountry);

if(listRight.options.length>0){

listRight.options[0].selected=true;

}

}

}

}

function move(listBoxTo,optionValue,optionDisplayText){

var newOption = document.createElement("option");

newOption.value = optionValue;

newOption.text = optionDisplayText;

listBoxTo.add(newOption, null);

return true;

}

</script>

</head>

<body>

<div>

<ul>

<li><table border="0">

<tr>

<td rowspan="3" align="right"><label>

<select name="selectLeft" size="10" id="selectLeft">

<option value="AS" selected="selected">American Samoa</option>

<option value="AD">Andorra</option>

<option value="AO">Angola</option>

<option value="AI">Anguilla</option>

<option value="AQ">Antarctica</option>

<option value="AG">Antigua And Barbuda</option>

<option value="AR">Argentina</option>

<option value="AM">Armenia</option>

</select>

</label></td>

<td align="left">&nbsp;</td>

<td align="left">&nbsp;</td>

<td rowspan="3" align="left"><select name="selectRight" size="10" id="selectRight">

<option value="AF" selected="selected">Afghanistan</option>

<option value="AX">&Atilde;&hellip;Land Islands</option>

<option value="AL">Albania</option>

<option value="DZ">Algeria</option>

</select></td>

</tr>

<tr>

<td align="left">&nbsp;</td>

<td align="left"><label>

<input name="btnRight" type="button" id="btnRight" value="&gt;&gt;" onClick="javaScript:moveToRightOrLeft(1);">

</label></td>

</tr>

<tr>

<td align="left">&nbsp;</td>

<td align="left"><label>

<input name="btnLeft" type="button" id="btnLeft" value="&lt;&lt;" onClick="javaScript:moveToRightOrLeft(2);">

</label></td>

</tr>

<tr>

<td>&nbsp;</td>

<td align="left">&nbsp;</td>

<td align="left">&nbsp;</td>

<td align="left">&nbsp;</td>

</tr>

</table>

</li>

</ul>

</div>

</body>

</HTML>

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How To Develop a HTML page to add and remove item from list box?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about General Arts & Entertainment

List of TM in FireRed?

http://faqs.ign.com/articles/490/490856p1.html


Which website can you get a list of when Pokemon evolve on Pokemon diamond?

This walkthrough has a list of the different ways Pokemon can evolve in the game: http://UK.faqs.ign.com/articles/783/783725p1.HTML also check out cerrebi net


Where are spots where there are dowsing items?

EVERYWHERE we wont make a list. tap the screen and it will make a dot if theres an item


Where can you buy chocolate covered peanuts on neopets?

The quickest way to buy an item on Neopets is to go to the Shop Wizard. Type in "Chocolate Covered Peanuts" and a list of shops with that have the item you are looking for will come up. Click on one of those shops (the cheapest one is on top) and then click on the item you want to buy.


Where do you find roast tentacle on Neopet?

To find an item you want to buy you type its name into the shop wizard. This will give you a list of users whose shops contain this item, the price and the quantity in that shop. To go to the users shop you click their username.

Related questions

What is the full form of li in HTML?

It stands for List Item.


How to make nested list using HTML tags?

To nest a list in HTML, you simply put the child list into a list item of the parent list. The parents list item will completely encompass the nested list. &lt;ul&gt; &lt;li&gt;Item One&lt;/li&gt; &lt;li&gt;Item Two&lt;/li&gt; &lt;li&gt;Item Three &lt;ul&gt; &lt;li&gt;Item 3.1&lt;/li&gt; &lt;li&gt;Item 3.2&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;!--This is the end of item 3--&gt; &lt;li&gt;Item Four&lt;/li&gt; &lt;/ul&gt;


What does the code li mean?

list item. it is the child of either &lt;ul&gt; - unordered list, or &lt;ol&gt; - ordered list in html


What type of HTML list wil automatically place a number in front of the item?

An ordered list: &lt;ol&gt; &lt;li&gt; First item &lt;li&gt; Second item &lt;li&gt; Third item &lt;li&gt; Fourth item &lt;li&gt; Fifth item &lt;/ol&gt;


What is HTML to list?

To make a numbered list in HTML, use the following code: &lt;ol&gt; &lt;li&gt;This would be item 1&lt;/li&gt; &lt;li&gt;This would be item 2&lt;/li&gt; &lt;li&gt;This would be item 3&lt;/li&gt; &lt;li&gt;And so on...&lt;/li&gt; &lt;/ol&gt; The &lt;ol&gt; tag starts the numbered list, while the &lt;/ol&gt; tag ends it. Each &lt;li&gt; tag starts a new item in the list. Each &lt;/li&gt; tag ends an item in the list. Just be sure to remember to close each list item before beginning the next one or before ending the whole list, otherwise your list will not format properly. For a list without numbers (a bulletpoint list), simple replace the &lt;ol&gt; tag with a &lt;ul&gt; tag, and the &lt;/ol&gt; tag with a &lt;/ul&gt; tag. Hope this helps! :)


How do you change the background of a bulleted list in HTML?

&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;style type="text/css" media="screen"&gt; ul { background: #FFFFFF; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt;


How can you make a list that lists the items with bullets in HTML language?

Like this:first entrysecond entry...'ul' is 'unordered list', using bullet points. 'li' is an item in the list.See related link to w3schools, they have a nice overview of all the HTML tags.


What is UL in HTML?

The UL tag is the opening tag that creates an unordered list. An unordered list has items with different bullets before them, rather than being numbered or having letters before them. The LI tag is a list item. The following is a simple example of an unordered list. &lt;ul&gt; &lt;li&gt; First item &lt;li&gt; Second item &lt;li&gt; Third item &lt;/ul&gt;


Once you have bid on an item on eBay are you still a watcher?

If the item is still in your watch list then yes, you are both a bidder and a watcher at the same time. if you bid and remove the item from your watch list then you are a bidder only and not a watcher.


Define lists in HTML?

It is often seen in a &lt;li&gt; tag, a tag in HTML is any recognized term between the signs &lt; and &gt;. you have different type of lists, &lt;ul&gt;&lt;li&gt;this is going to have bullets&lt;/li&gt;&lt;/ul&gt; &lt;ol&gt;&lt;li&gt;This is going to be marked in numbers&lt;/li&gt;&lt;/ol&gt; then &lt;ol&gt; or ordered list categorizes in to different formats. eg, &lt;ol type="1"&gt;&lt;li&gt;this is going to have numbers&lt;/li&gt;&lt;/ol&gt; &lt;ol type="a"&gt;&lt;li&gt;this is going to be marked from a to z&lt;/li&gt;&lt;/ol&gt; &lt;ol type="I"&gt;&lt;li&gt;this will mak it is I and II and III and IV sort of thing&lt;/li&gt;&lt;ol&gt;


How do you make a list that lists its items with squares in HTML?

&lt;li&gt;Enter the text that you want to list here&lt;/li&gt; &lt;li&gt;Enter the next item that you want to list here&lt;/li&gt; And so on until all the items you want to list are listed.


What is a list in HTML?

A list in HTML defines a collection of items. List can be ordered (OL) or Unordered (UL).