Jump to content

Drop down menu and typing in website


Recommended Posts

Hi, I need help. Attached is a screenshot of something I would like to try to add in my website.

basically there is a drop down menu to choose font and there is a row to type the name you want to see how it looked like in the chosen font type.

how to code it? I’m a beginner just learning.



Link to comment
Share on other sites

This'll be the main part of your script


You might be able to use a variation of the example shown.

var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myP").style.fontFamily = listValue;

You'd probably need to run this code when the value changes so this may also be of use to you.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...