0

I am getting java script error like :

Uncaught Error: Syntax error, unrecognized expression: input#comment_1/2

the only comment keyword i have used in cshtml file is in this line code.

 <input placeholder="Enter your comments" type="text" style="width:800px;" id="comment_@item/@kpi.Id" name="comment_@item/@kpi.Id" />

i did not use comment keyword any where in java script, But i am getting this error. Thanks.

Manish Kumar
  • 595
  • 2
  • 5
  • 20

1 Answers1

0

This is happening because comment_@item/@kpi.Id is not a valid value for an element's ID, so jQuery is unable to parse your selector.

From the HTML4 spec:

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

The solution is to use a valid value for your ID. see answer

Community
  • 1
  • 1
Ala
  • 1,505
  • 1
  • 20
  • 36