Hi Clinton, welcome to JavaRanch!
You can't put
Java into HTML, but you can make a
JSP with Java scriptlets embedded or, preferably, a
servlet that does the dynamic part, and a JSP that displays the results. For relatively simple behavior like this, it wouldn't take much to translate your HTML into either solution, but you would need a Java app server to be your servlet container. That is you'd need something like
Tomcat,
JBoss, WebLogic, etc,, to run on your server.
On the other hand,
you should be able to implement what you want with JavaScript and cookies, in which case, you wouldn't need a servlet container at all.