Hostelworld Group interview question

How do you get the value of a text field using javascript