An input must be driven either high or low, you cannot leave it unconnected, (also called floating) or it will not function correctly.
If you want input from a switch, you would use a switch to either 5V or ground, and a resistor to the opposite, so that it is always one or the other...