What you need to do is download jquery library or use the external google cdn library as the one i have used in my case in the head of your html file.

Ensure that you append the input on the form as the document loads.
If you intend to submit your form to Php as the server side check if the form is posted and print the output.
You should save your file with .php extension.