var firstName = "имя"; id = document.getElementById('lbFirstName').attributes["for"].value; document.getElementById(id).value=firstName;