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


// Assign text and value to Option object

opt.text = Text;

opt.value = Value;


<script />

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: Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: