0

When trying to change the text of an element using a dynamic selector I got Jquery error here is my Jquery code :

        var idx = ".counter-up,."+json.updates[i].key; 
        var old = parseInt($(idx).text());

I get the error Syntax error, unrecognized expression: .counter-up,. http://jsfiddle.net/toulmek/CPAjC/

Tarik Mokafih
  • 1,247
  • 7
  • 19
  • 38

1 Answers1

0

Your id cannot have spaces in it. It doesn't work like class where you can specify multiple values, the element can only have one id.

See this link: What are valid values for the id attribute in HTML?

Community
  • 1
  • 1
oyvind
  • 1,429
  • 3
  • 14
  • 24