Works like documentready but with elements