I'm interested in adding a drop-down box to my webpage that allows users to change the font of the site when they click on it.
I attempted the code below, but it didn't seem to work. Any suggestions?
Regards, Sam
CSS
.font1 p { font-family: "Times New Roman", Times, Serif; }
.font1 h1 { font-family: "Times New Roman", Times, Serif; }
.font1 h2 { font-family: "Times New Roman", Times, Serif; }
.font1 h3 { font-family: "Times New Roman", Times, Serif; }
.font1 h4 { font-family: "Times New Roman", Times, Serif; }
.font1 h5 { font-family: "Times New Roman", Times, Serif; }
.font1 h6 { font-family: "Times New Roman", Times, Serif; }
.font1 th {font-family: "Times New Roman", Times, Serif; }
.font1 tr {font-family: "Times New Roman", Times, Serif; }
.font2 p { font-family: Arial, Helvetica, sans-serif; }
.font2 h1 { font-family: Arial, Helvetica, sans-serif; }
.font2 h2 { font-family: Arial, Helvetica, sans-serif; }
.font2 h3 { font-family: Arial, Helvetica, sans-serif; }
.font2 h4 { font-family: Arial, Helvetica, sans-serif; }
.font2 h5 { font-family: Arial, Helvetica, sans-serif; }
.font2 h6 { font-family: Arial, Helvetica, sans-serif; }
.font2 th {font-family: Arial, Helvetica, sans-serif; }
.font2 tr {font-family: Arial, Helvetica, sans-serif; }
</style>
HTML
<div>
<select>
<option value="Choose a font">Choose a Font</option>
<option value="Font1" ng-click="font1">Font1</option>
<option value="Font2" ng-click="font2">Font2</option>
<option value="Font3" ng-click="font3">Font3</option>
<option value="Font4" ng-click="font4">Font4</option>
</select>
</div>