javascript - can two IF condition work simultaneously -


i created js program check condition using 2 if conditions simultaneously. why doesnt work? fiddle

    function displayicon() {     var = 1;     var = 2;     if (a == 1) {          $('.clist').show();         $('.vprint').show();         $('.vfilter').show();         $('.vsaveas').show();         $('.vshare').show();     } else if (a === 0) {          $('.vprint').show();         $('.vfilter').show();     }      if (i == 2) {         $('.alertinfo').show();     } else if (i == 4) {         $('.alertinfo').hide();     } } 

it works fine me. have make work in jsfiddle is:

  • enable jquery plugin, $ defined; and
  • change function wrapping "no wrap", otherwise displayicon function defined within wrapper , cannot accessed button.

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -