title: google web fonts in a DropDown list dynamically with respective Font Weights
body: <p>I've created a function to add google fonts in a <code>select</code>. But I've 2 issues: </p>
  
  <ol>
  <li>I had to add all google fonts name manually in a variable <code>fonts</code>. </li>
  <li>I cannot find a way to add <code>font-weight</code> that a font supports, as all google font doesn't support all <code>font-weight</code> <code>100-900</code></li>
  </ol>
  
  <p>Is there any way I can add the google font's dynamically with respective <code>font-weights</code>?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>(function ( $ ) { 
    $.fn.webfonts = function(font) {
     var font_set = "";
     font_set = font;
  
     var fonts = ["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Odor Mean Chey","Offside","Old Standard TT","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab"];
     var font_preview = 0;
     var font_list = '&lt;option value=""&gt;None&lt;/option&gt;';
  
     for (var i=0; i &lt; fonts.length; i++){
         font_list += '&lt;option value="'+ fonts[i] + '"&gt;' + fonts[i] + '&lt;/option&gt;';
     }
  
     this.addClass('webfonts').append(font_list);
  
        $(this).find('option').each(function(){              
               if($(this).val()==font_set ){
                   $(this).attr('selected','selected');
               }
           });
    };    
    
       $('#google-fonts').webfonts();
   }( jQuery ));</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;select id="google-fonts"&gt;&lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>