Cognizant interview question

Write a code for validation using javaScript for a input id(length atleast seven) ?