todo: use el.id = .. instead of el.setAttribute(id, ..) for those attributes that allow it.