Problem with tactile switch

I'm no electronics wizard, so the solution to this is probably very simple....

I have a tactile switch, I have wired this in series with a resistor and LED to a digital pin configured as output. When I write the the digital output the LED does not light until I depress the tactile switch. This works, its clear to me why and I understand it.

Then I wired the tactile switch to a digital pin configured as input. Another pin is configured as output with a resistor and LED connected.

In the code I read the digital input and if its HIGH set the digital output HIGH, if not I set the digital output LOW. This doesn't work and I'm struggling to see why not. The wiring for this is as follows:

(+) from pin 8 (configured as input) to one side of switch. (-) from other side of switch connected to GND.
(+) from pin 13 (configured as output) to resistor, other side of resistor to longer leg of LED, short leg of LED connected to GND.

I'm trying to write a debounce routine using my timer libary, but failing to see why this doesn't work.

Did you turn on the internal pullup resistor so the input pins sits a solid high level when switch is not pressed?

pinMode (pin8, INPUT);
digitalWrite (pin8, HIGH);

No...I'm really confused and experiencing some very odd behaviour.

I have a prototype breatboard which only has the components as mentioned above. I'm monitoring the application via serial.print output statements. Nothing happens at all, until I move my finger over the bread board. I'm not touching anything, just moving my finger over the components, on the serial output I see that the input is going high momentarially then low again, this happens very realiabily as I move my hand back and forth.

Is this normal?

Turn on the internal pullup resistor, will keep the pin being read from acting like an antenna.

Thank you, worked like a charm, now when switch depressed input is LOW, when not depressed HIGH. I can modify my code to suit.

Thanks again!

There you go.

Nothing happens at all, until I move my finger over the bread board.

I have videos showing why this happens: