javascript - Creating variable array for keycode -


i trying create single variable contains of function key codes. if remove brackets , use single keycode works.

$('input').keyup(function (e) {      var functionkeyspressed = e.which == [114, 115, 116, etc];      if (!functionkeyspressed) {      }  }); 

use indexof()

$('input').keyup(function (e) {      var functionkeyspressed = [114, 115, 116, etc].indexof(e.which) > -1;      if (!functionkeyspressed) {      }  }); 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -