Handling an ID's special characters in jQuery


/ Published in: jQuery
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. // incorrect
  2. $('#my.id.name').val();
  3.  
  4. // correct
  5. $('#my\\.id\\.name').val();

Report this snippet


Comments


You need to login to view comments.