-1

I'm using this id(tel / fax) in this line

$("#" + val.target.id).attr('disabled', 'disabled');

then I get an error like:

Syntax error, unrecognized expression: #tel / fax

freedomn-m
  • 21,261
  • 4
  • 28
  • 53

2 Answers2

0

You cannot have spaces in id attribute. you can replace the space with any other character with replace() function.

ShebinPB
  • 1
  • 1
0

ID should be one word without spaces and special chars. jQuery selecting works same as css selecting. For example, if you cannot write in your css #tel / fax {...} then you cannot do same in your jQuery - $('#tel / fax'); would throw you an error.

Just change your ID of element and it will work.