Just a simple circuit showcasing how a mosfet and transistor might work as a switch. You can also see how a nosfet can remain on even after the input is disconnected by flipping the switch. This is caused by capacitance inside of the mosfet whereas the transistor does not. If you use this circuit for a mosfet you can simply put a resistor between the two input wires to get rid of the capacitance. This is called a pull down resistor. Have fun!