RSS

Way of adding items in Drop Down List or List Box using Javascript

26 Jun

<script type=”text/javascript”>

function AddItem(Text,Value)

{

// Create an Option object

var opt = document.createElement(“option”);

// Add an Option object to Drop Down/List Box

document.getElementById(“DropDownList”).options.add(opt);

// Assign text and value to Option object

opt.text = Text;

opt.value = Value;

}

<script />

Advertisements
 
Leave a comment

Posted by on June 26, 2010 in ASP Dot Net C#

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: