RE: JQuery Passing Var Value Issue

Hi,

I’m trying to a write a bit of jQuery which will take the value of an id where a class equals .noshade.

This gets passed to a VAR which I can then use to change CSS elements in the document however I keep getting

Error: uncaught exception: Syntax error, unrecognized expression: NaN]

Any advice?

$(".next").click(function() {
		var nValue = $('.widget_style>ul>li[class=noshade]')
		.next().attr("value");
		$('.widget_style>ul>li[value='+nValue-1+']')
			.toggleClass('shade')
			.$('#oCookingTip>#tip'+nValue-1).css('display','block');
	});

http://cookingsecrets.togetheragency.co.uk:8080/index.htm#

Thanks

NaN = not a number. That means that the following selector doesn’t return a number:

$(‘.widget_style>ul>li[class=noshade]’).next().attr(“value”);

Try firebug (on firefox) and do a console.log(nValue); under the selector.