This method shows the results faster than the method of using frameworks.
getElementsByTagName: Used to get elements by their class or id from html.
createElement(“type”): create element creates an element of the passed type
appendChild(node): Appends the passed node at the end of attached parent.
At first output will be like below-
And when B is put inside of the box then output becomes like below-
2) USING JQUERY
JQuery has an inbuilt autocomplete function which takes id and a list of available tags.
Type a letter to see recommendations and click to complete the text automatically.
At first, output will be like below-
And when D is put inside of the box then output becomes like below-