Simple Item Selector Using jQuery

3 min read

(For more resources on jQuery, see here.)

Adding jQuery to your page

You can download the latest version of jQuery from jQuery site ( and can be added as a reference to your web pages accordingly. You can reference a local copy of jQuery using <script> tag in the page. Either you can reference your local copy or you can directly reference remote copy from or Google Ajax API (

Prerequisite Knowledge

In order to understand the code, one should have the basic knowledge of HTML, CSS, JavaScript and basic knowledge of jQuery.

Ingredients Used

  • HTML
  • CSS
  • jQuery
  • Photoshop (Used for Designing of Image Buttons and Backgrounds)

Preview / Download

If you would like to see the working example, please do click here And if you would like to download the snippet, click here (


Figure 1: Snapshot of “Simple Item Selector using jQuery”


Figure 2: Overview of div containers and image buttons used

Successfully tested

The above application has been successfully tested on various browsers like IE 6.0, IE 7, IE 8, Mozilla Firefox (Latest Version), Google Chrome and Safari Browser (4.0.2) respectively.


Below is the HTML code with comments for you to understand it better.

<!-- Container -->
<div id="container">
<!-- From Container -->
<div class="from_container">
<select id="fromSelectBox" multiple="multiple">
<option value="1">Adobe</option>
<option value="2">Oracle</option>
<option value="3">Google</option>
<option value="4">Microsoft</option>
<option value="5">Google Talk</option>
<option value="6">Google Wave</option>
<option value="7">Microsoft Silver Light</option>
<option value="8">Adobe Flex Professional</option>
<option value="9">Oracle DataBase</option>
<option value="10">Microsoft Bing</option>
</select><br />
<input type="image" src="images/selectall.jpg" class="selectall"
onclick="selectAll('fromSelectBox')" /><input type="image"
src="images/deselectall.jpg" class="deselectall" onclick="clearAll('fromSelectBox')" />
<!-- From Container [Close] -->
<!-- Buttons Container -->
<div class="buttons_container">
<input type="image" src="images/topmost.jpg" id="topmost" /><br />
<input type="image" src="images/moveup.jpg" id="moveup" /><br />
<input type="image" src="images/moveright.jpg" id="moveright" /><br />
<input type="image" src="images/moveleft.jpg" id="moveleft" /><br />
<input type="image" src="images/movedown.jpg" id="movedown" /><br />
<input type="image" src="images/bottommost.jpg" id="bottommost" /><br />
<!-- Buttons Container [Close] -->
<!-- To Container -->
<div class="to_container">
<select id="toSelectBox" multiple="multiple"></select><br />
<input type="image" src="images/selectall.jpg" class="selectall"
onclick="selectAll('toSelectBox')" /><input type="image"
src="images/deselectall.jpg" class="deselectall" onclick="clearAll('toSelectBox')" />
<!-- To Container [Close] -->
<!-- To Container -->
<div class="ascdes_container">
<input type="image" src="images/ascending.jpg" id="ascendingorder"
style="margin:1px 0px 2px 0px;" onclick="ascOrderFunction()" /><br />
<input type="image" src="images/descending.jpg" id="descendingorder"
onclick="desOrderFunction()" />
<!-- To Container [Close] -->
<div style="clear:both"></div>
<!-- Container [Close] -->


Please enter your comment!
Please enter your name here