Basically, I am trying to use a data attribute from a input text element to set a default value:
$('.fontsizepick').val($("#preview-iframe").contents().find($(this).data('obj')).css('font-size'));
The goal is to get the font size from another element and give it as a value to this input text element. There can be many elements.
This does not work. It gives me no error either.
Here is How I did it with a select:
$(".fontpick option").filter(function() {
//may want to use $.trim in here
return $(this).text() == $("#preview-iframe").contents().find($(this).parent().data('obj')).css('font-family');
}).prop('selected', true);
So, I am wondering how I can set a element with a class and give it a value and use its own attributes, basically I want access to the $(this)...
How can I do that?