A person is guilty of creating a hazard when:
1. Having discarded in any place where it might attract children, a container which has a compartment of more than one and one-half cubic feet capacity and a door or lid which locks or fastens automatically when closed and which cannot easily be opened from the inside, he fails to remove the door, lid, locking or fastening device; or
2. Being the owner or otherwise having possession of property upon which an abandoned well or cesspool is located, he fails to cover the same with suitable protective construction.
Creating a hazard is a class B misdemeanor.