Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > <select> <option> an element in DOM ?

Reply
Thread Tools

<select> <option> an element in DOM ?

 
 
John Grandy
Guest
Posts: n/a
 
      05-11-2007
For an html <select> control , does the browser store each <option> as a
separate element in the DOM tree ?

Or are the select options stored in some other manner ?


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      05-11-2007
Something like

<select name="sample" id="sample">
<option value="1">The first</option>
<option value="2">The Second</option>
<option value="3">The Third</option>
</select>
<script type="text/javascript">
function showOptions()
{
var ddl=document.getElementById('sample');
for(i=0;i<ddl.options.length;i++)
{


alert('Text:' + ddl.options[i].text + ',value:' +
ddl.options[i].value);
}
}
</script>
<input type="button" onclick="showOptions()" value="Show options"
/>

should show you the idea


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"John Grandy" <johnagrandy-at-gmail-dot-com> wrote in message
news:...
> For an html <select> control , does the browser store each <option> as a
> separate element in the DOM tree ?
>
> Or are the select options stored in some other manner ?
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to Update/insert an xml element's text----> (<element>text</element>) HANM XML 2 01-29-2008 03:31 PM
set dom element class (if element was dynamically created) ted benedict Javascript 3 01-27-2006 01:29 AM
What is the difference between DOM Level 1 and DOM Level 2. mike XML 1 11-20-2004 03:19 PM
Difference between pure DOM and JAXP over DOM ?? Thorsten Meininger XML 0 07-28-2004 08:51 AM
Difference between pure DOM and JAXP over DOM ?? Thorsten Meininger Java 0 07-28-2004 08:51 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57