Reputation: 8990
$('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
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