Interactive inputs recursive

creates an object if element has child elements and if it not creates
properties instead.