Getting "Expected ',' or '{' but found '#44559'" error. My code looks like this:
var valueid = $("div#center-box div#empid-textbox input").val(); //valueid=44559
if($("div#esd-names li#" + valueid).length > 0){
//DO SOMETHING;
};
I'm getting the value of what is entered into a textbox input field which in case is "44559" can't seem to figure out why I'm getting this error.
I call my valueid retrieving function with the following code. After you press ENTER in a specific textbox the value of the textbox is retrieved and ran against list items to see if it exists...if it does -- //DO SOMETHING//
$("div#center-box div#empid-textbox input.id").keypress(function(e){
key = e.which;
if(key===13){
valueid = $("div#center-box div#empid-textbox input").val();
if($("div#esd-names li[class*='" + valueid + "']").length > 0){
//DO SOMETHING;
};
};
});