how can i get the element of this list?

here is my code

<select id="itemsTbx" name="originSel" onchange="checkOriginDest()">
<option value="B">Bacolod
<option value="C">Cebu
<option value="M">Manila
<option value="Z">Zamboanga

for example i want to get Cebu.. what is the code for that?

Please help me... tanx

Recommended Answers

All 3 Replies

what actually you want! please clarify briefly so that i can understand...

I don't know what you want exactly, but your html should look like this:

<select id="itemsTbx" name="originSel" onchange="checkOriginDest()">
<option value="B">Bacolod</option>
<option value="C">Cebu</option>
<option value="M">Manila</option>
<option value="Z">Zamboanga</option>
</select>

If you want to get code in a variable you can use this:

var cod = document.getElementById('itemsTbx').value();

do you want to take list value in php or javascript?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.