Searching drop down when typing value

Hi i'm trying to write JS code to search dropdown values what are from a SharePoint look up field
if I type a name it brings the exact match

Dear @VishMG,
What dropdown are you talking about? If it's a Lookup field/control, you can choose an operator for the search functionality to either search values that Start With string/Contain string that users input:

This can be selected in field properties in the editor when selecting a field.

If it's Dropdown/Choice field, please, let me know how the values from the lookup are populated in it.