Mich1982 Posted May 4, 2019 Share Posted May 4, 2019 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 More sharing options...
Funce Posted May 5, 2019 Share Posted May 5, 2019 This'll be the main part of your script https://www.w3schools.com/jsref/prop_style_fontfamily.asp 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. https://www.w3schools.com/jsref/event_onchange.asp Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now