Load google font script based on optgroup label selected

Đã có trọn bộ đề thi thử THPT Quốc Gia 2022 các môn: vip.dethihsg247.com

Ive searched and can’t find an answer. I have two groups of fonts – one regular fonts and one google fonts. Im using a select dropdown list with two optgroups, one for each group of fonts. What Im trying to accomplish is to load the script for google fonts on the front-end only if a font is selected under that optgroup label. Im able to get the value of the font-family selected in the option, but not the optgroup. I’ll attach a screenshot of the dropdown in the admin area.

enter image description here

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com