If I have a varibale that changes on certain conditions how do I select it using Jquery selectors?
var id = 2
alert($(\'.\'+id+ \' .title\').val());
<
your problem here is that you are starting a classname with a number. class names must start with an _ a - or a letter.
switch up your structure so its:
var id = 2
alert($('.' + 'title' + id).val());
or some variation so that id starts with an underscore, dash, or letter:
var id = 2
alert($('._' + id + ' .title').val());