Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8960637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:42:14+00:00 2026-06-15T15:42:14+00:00

https://stackoverflow.com/q/5065542/1716774 I like to apply the same function in my Fiddle HTML <select id=styleFont>

  • 0

https://stackoverflow.com/q/5065542/1716774
I like to apply the same function in my Fiddle

HTML

  <select id="styleFont">
          <option value="0">Myraid Pro</option>
          <option value="1">Sans ref</option>
          <option value="2">Times New Roman</option>
          <option value="3"> Arial</option>
 </select>
 <br>
  <textarea id="custom_text"></textarea> 

CSS

 #custom_text{ resize: none;}​

Script

      $("#styleFont").change(function () {
     var id =$('#styleFont option' + ':selected').text();    
    $("#custom_text").css('font-family',id);
    });​

I tried to add the google API fonts in my select box by using

https://www.googleapis.com/webfonts/v1/webfonts?key=YOUR-API-KEY

how to add this to my fiddle

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:42:15+00:00Added an answer on June 15, 2026 at 3:42 pm

    Use a JSONP request and add each returned font to a select:

    function SetFonts(fonts) { 
        for (var i = 0; i < fonts.items.length; i++) {      
         $('#styleFont')
             .append($("<option></option>")
             .attr("value", fonts.items[i].family)
             .text(fonts.items[i].family));
        }    
    }
    var script = document.createElement('script');
    script.src = 'https://www.googleapis.com/webfonts/v1/webfonts?key=API_KEY&callback=SetFonts';
    document.body.appendChild(script);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the same question as this: https://stackoverflow.com/questions/2890620/jquery-running-a-function-in-a-context-and-adding-to-a-variable But that question was poorly posed.
Further to https://stackoverflow.com/questions/8990246/frame-like-in-html/8990407#8990407 I implemented floating divs in my JSP. It works properly in
Same question as https://stackoverflow.com/questions/3100878/ipad-frame-programmatically-doesnt-match-with-ib but no-one answered! I created a UITableCell layout in IB,
Duplicate: https://stackoverflow.com/questions/587676/why-do-programs-in-unix-like-environments-have-numbers-after-their-name/ For instance, if I type: man ps ...and then scroll to the
https://stackoverflow.com/a/5524120/462608 If you want to call functions recursively, which lock the same mutex, then
Related: https://stackoverflow.com/a/2910549/194031 I have a string like: abc defgh <!inc(C:\my files\abc.txt)!>kdi kdkd<!inc(C:\my files\abc.txt)!> and
Duplicate of https://stackoverflow.com/questions/885696/how-do-i-perform-a-better-colorize-function I am using this function in vb2005 to colorize a pixel,
Extension from https://stackoverflow.com/a/55191/547210 I am creating a validating function to check several attributes of
In this answer : https://stackoverflow.com/a/4481896/1486928 there is a line like this : UITableView *tableView
This question is an extension of https://stackoverflow.com/q/438163/1168342 I'd like to know specifically if there's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.