How to make a permanent change to an element after using jQuery's .keydown()? -


i have following jquery code:

function showresult(str) { if (str.length == 0) {     $('#mysearch').html('');     return; } else {     $('#mysearch').load('search/'+str,function(){         $('#mysearch').css({             'background-color': 'white',             'width': '250px',             'position': 'absolute',             'right': '0'         })     }); }  $(document).click(function(event) { if ( !$(event.target).hasclass('mysearch')) {      $('#mysearch').html('');      $('#main_search').val(''); } });  $(document).keydown(function(e){     if (e.keycode == 40) {         $('#mysearch tr.myrow:first').addclass("a_classy_class");        return false;     } }); } 

when press down arrow key class 'a_classy_class' added tag id 'myrow'. however, stop pressing down arrow key class removed. how make change permanent, after stop pressing down arrow key change holds?

in addition other suggestions, if page reloaded, changes not persist.


Comments

Popular posts from this blog

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -

How do I get the nth item in a queue in java? -

How to read input from STDIN in x86_64 assembly? -