getaway
getaway

Reputation: 8990

getting the value of font and putting storing?

$('select[name="content_fonts"]').change(function(){
    $('.leftpanel').css('font-family', $(this).find(":selected").text());
    $('#panelfont').val($(this));

im trying to get the value of the font being inserted into .leftpnael class and putting in the #panelfont value!! but its giving [object object]!!!

Upvotes: 0

Views: 24

Answers (1)

Emmett
Emmett

Reputation: 14327

$(this) will not return the font, as it refers to the #panelfont element. You need $('.leftpanel').css('font-family') instead:

$('#panelfont').val($('leftpanel').css('font-family'));

Upvotes: 1

Related Questions