我认为这就是你想要的:
演示:http: //jsfiddle.net/SO_AMK/JjutY/
HTML:
<div class="div1">
<div class="div2">
Some text, and more, and more, and more, and more, and more, and more, and more, and more.
</div>
<div class="div3">
Some text, and more, and more, and more, and more, and more, and more, and more, and more.
</div>
<button class="increaseFontSize">Increase Font Size</button>
</div>
jQuery:
$(".increaseFontSize").click(function(){
var fontSize = getFontSize($(".div3"));
var newFontSize = fontSize + 2;
$(".div3").css("font-size", newFontSize);
return false;
});
function getFontSize(element) {
var currentSize = $(element).css("font-size");
var currentSizeNumber = parseFloat(currentSize);
return currentSizeNumber;
}
</p>