Posted By

penguin999 on 04/16/09


Tagged

jquery id special characters


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

maxvee8


Handling an ID's special characters in jQuery


 / Published in: jQuery
 

One must escape "special characters" in id names using two backslashes.

  1. // incorrect
  2. $('#my.id.name').val();
  3.  
  4. // correct
  5. $('#my\\.id\\.name').val();

Report this snippet  

You need to login to post a comment.