The J-K flip-flop is the most versatile of the basic flip-flops.
It has the input- following character of the clocked D flip-flop
but has two inputs,traditionally labeled J and K. If J and K are
different then the output Q takes the value of J at the next clock
edge.
If J and K are both low then no change occurs. If J and K are
both high at the clock edge then the output will toggle from one
state to the other. It can perform the functions of the set/reset
flip-flop and has the advantage that there are no ambiguous states.
It can also act as a T flip-flop to accomplish toggling action if J
and K are tied together. This toggle application finds extensive
use in binary counters.