In my JavaScript and HTML5 course, I am working on developing a website where users can choose the background color and decide between using SANS SERIF or SANS fonts. The background color selection feature is already functioning successfully --
var inputColor = prompt( "Enter a color name for the " +
"background of this page", "" );
document.body.setAttribute( "style", "background-color: " + inputColor );
However, I am facing difficulty in implementing a similar method for font selection without overwriting the newly chosen background color.
I would greatly appreciate any suggestions to help me resolve this issue.