A foldable electronic device is provided, which includes a hinge structure, a first housing that is connected to the hinge structure, a second housing that is connected to the hinge, a first vibration element disposed in the first housing, a first motion sensor disposed adjacent to the first vibration element, a second motion sensor disposed in the second housing, a processor, and a memory. The memory stores instructions that, when executed, cause the processor to control vibration intensity of the first vibration element, based on a first value measured from the first motion sensor and a second value measured from the second motion sensor.