I am trying to re-size the font size of one of my divs in jquery using an input. Ideally, the number put inside the input box would be added on to the existing font size but so far my attempts have been unsuccessful.
Here is what I have so far but it does not seem to be working:
HTML
<div class="resizeable" style="font-size: 30px;">test</div>
<input type="text" name="size" class="size" />
JQuery
$(document).ready(function() {
$('.size').keyup(function() {
var currentFontSize = $('this').css('font-size');
var input = $(this).val(); // grab the input value
var newsize = input + currentFontSize;
console.log(size);
if ($(this).val().length > 0)
{
// replace css value on live preview
$('.resizeable').css('font-size', newsize);
}
});
});
JSFiddle http://jsfiddle.net/eqE2R/36/
Any help would be appreciated.