You might wanna have a look at the Selectors tutorial,
http://docs.jquery.com/DOM/Traversing/Selectors

Also this might help a bit: http://docs.jquery.com/How_jQuery_Works


On 6/9/07, Guoliang Cao <[EMAIL PROTECTED]> wrote:


Hi,

I have below test html file and can not get it to display the selected
value. Can someone please let me know what I missed?

Thank you.
Guoliang

I'm using jquery 1.1.2 and IE 6 SP2 (6.0.2900.2180)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html debug="true">
<head>
<meta http-equiv="Content-Type" content="text/html">
<title>Test Page</title>
<script language="JavaScript" type="text/javascript" src="jquery.js"></
script>
<script language="JavaScript">
function openGame(){
        var option = $("games [EMAIL PROTECTED]");
        alert(option.text());
}
</script>
</head>
<body>
Select one:
<select name="games">
        <option selected="true">games/test1.sgf</option>
        <option>games/test2.sgf</option>
        <option>games/test4.sgf</option>
</select>

<script language="JavaScript" type="text/javascript">
openGame();
$("games").change(openGame);
</script>
</body>
</html>


Reply via email to