Hi,
I am trying to make a form to run a function on keyup, keydown.
The markup is:
Georgia
Times New
Roman
Helvetica Neue Light
I made a function that change the font-family on click:
$(document).ready(function(){
$('#family').click(function() {
value = $(this).val();
$('.cica').css('font-family', value)
});
});
//capture the down key
$("#family").bind("keydown", function(e) {
if (e.keyCode == 40) {
value = $(this).val();
$('#family').css('font-family', value)
return false; //prevent default behavior
}
});
I am trying to bind a keydown to this form so when I press Down key
the form change its value and execute the function - change the font-
family.
It looks that my bind keydown does nothing. What should I change here?
Thank you.