Jump to content

Archived

This topic is now archived and is closed to further replies.

hvle

variables precendance and descendance

Recommended Posts

It is like this:

i have a html file like this:

<html>
<body>
<select id="continent" name="continent">
<option value="Africa">Africa</option>
</select>

</body>
</html>

it's a select named continent.

how do I regard or pass this 'continent' as a variable in a java script?

case 1: somefunction(continent); or
case 2: somefunction(document.continent)

i know in IE, you can pass it like case 1.
but other browser won't take it.

any idea?

Share this post


Link to post
Share on other sites
use document.getElementById('continent').value to get the select value.

Share this post


Link to post
Share on other sites
that's it, thanks

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.