Thanks a lot. I didn't know $("name") means looking for element by tag
name.
Guoliang
On Jun 9, 1:22 pm, "Matt Stith" <[EMAIL PROTECTED]> wrote:
> When you select using something like $("stuff"), jquery looks for a
> tag, which oviously doesnt exist. To search by class, you use $(".stuff"),
> a
When you select using something like $("stuff"), jquery looks for a
tag, which oviously doesnt exist. To search by class, you use $(".stuff"),
and to search by ID you use $("#stuff").
In your case, you wanted to search for a select by name, so you would do
$("[EMAIL PROTECTED]'stuff']")
Or, lik
Thank you for your help. But your code doesn't work here. I changed to
use id and suddenly everything worked. Here is the new code
Test Page
function openGame(){
var option = $("#games [EMAIL PROTECTED]");
alert(option.text());
}
Select one:
games/test1.sgf
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 sel
Try this:
function openGame(){
var option = $("#games option:selected");
alert(option.text());
}
$(function() {
openGame();
$("#games").bind('change',openGame);
});
Select one:
games/test1.sgf
games/test2.sgf
games/test4.sgf
On 6/9/07, Guoliang Cao <[EMAIL PROTECTED]>
5 matches
Mail list logo