I’m trying to select a data attributes value that has a space or a certain character in it but it doesn’t like it very much. Below is the code that I have working for one worded attribute values.
$('div[data-roomtype='+$(this).data('roomtype')+']').animate({opacity:0.1},100);
And I have also put together a very simplified fiddle (http://jsfiddle.net/Tse6k/2/) of what I’m hoping to achieve. Is there an easy solution to this? Any help or advice would be much appreciated.
Quote the value in the selector:
DEMO: http://jsfiddle.net/Tse6k/3/