views:

247

answers:

1

Is there a list of jQuery reserved words published somewhere?

I ask because jQuery won't return a value for a class I'm using called "selected". If I change the class name to something else it is found.

Example:

<ul>
<li><a id="a1" class="selected" href="#tab1">Part I</a></li>
</ul>

alert($('ul li a').attr("class"));

I get an empty alert box. But if I change the class name to "selected_", I get "selected_" back in the alert box.

I'm guessing "selected" is a jQuery reserved words. I've found lists of Javascript reserved words and "selected" is not, as far as I can tell, a Javascript reserved word.

A: 

I am not sure this issue exists anymore. Using 1.4.2 I get 'selected' in my alert box.

<html><head>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script language='javascript'>
$(document).ready(function a () {
    alert($('ul li a').attr("class"));
});
</script></head>
<body>
<ul>
<li><a id="a1" class="selected" href="#tab1">Part I</a></li>
</ul>
</body></html>
Jack B Nimble