Tech Mahindra interview question

Question based on JavaScript for accessing form element using Java script.