I am using this code ti dynamically select attributes of a element but it gives me an error in firebug
Error:
uncaught exception: Syntax error, unrecognized expression: ”
Here is my code:
jQuery('.mydata').click(function(){
var current_id=jQuery(this).attr('id');
var current_datatype=jQuery(this).attr('datatype');
var next_id=parseInt(current_id);
next_id=next_id+1;
next_id="'#"+next_id+"'";
var next_datatype=jQuery(next_id).attr('datatype'); //this line gives error
});
What if you do
next_id = "#" + next_id;instead ofnext_id="'#"+next_id+"'";