I'm trying to match an input value against a data attribute but it doesn't seem to be working. Here's the code:
HTML:
<input value="" data-match="Training">
jQuery:
var wrd = $('.js-search-input').data('match');
$('.js-search-input').on('keyup keydown paste', function () {
if ($(this).val().toLowerCase() === wrd) {
$('.search-demo-text').show();
}
});
Has anyone got any ideas on the best way to match the input value based on the data-* attribute.
jsFiddle: http://jsfiddle.net/JQ8Sa/1