I'm creating a web application, where I got a simple problem which I can't solve. I've put the code which creates the problem here: http://jsfiddle.net/rkumarnirmal/5w3FG/
What's problem with the second alert() which should display this answer
current
The problem is:
var b = '.something';
var c = $(b).attr("id");
alert(c);
is not showing the id.
But, When I give
var c = $('.something').attr("id");
alert(c);
It works. Have I done anything wrong with the selector?
Thanks!