I had using jQuery 1. I changed it to 2. 1 and the problem is solved ( jquery_ update module). try adding quotes, as: var pro = $ ( ' # properties' ). find( " option[ value= ' " + user_ property. replace( ' ', ' - ' ) + " ' ] " ) ;. or better break it down to: var replaced. 1: 2 Uncaught Error: Syntax error, unrecognized expression: # at Function. We have implemented the back button on our header for a phone gap app. Clicking on the back button intermittently gives this error " Uncaught. handleFragmentLinkClickOrHashChange is a function defined in the Drupal script form. js which attempts to scroll to the corresponding element. The console in Chrome just outputs the following message: Uncaught Syntax error, unrecognized expression: # I' m running the latest core and the latest of all. Syntax error, unrecognized expression: a[ href* = # ] : not( [ href= # ] ) # 2885. DevelopOnline opened this Issue on Jan 29, · 3 comments.