I want to increase font size in whole page when user click on increase button. It will be increase on bases of current font size. Following is sample code :
<div class='parent' style='font-size:15px'>
<div class='c1'>div 1</div>
<div class='c2'>div 2</div>
<div class='c3'>div 3</div>
<div class='c4'>div 4</div>
<table style="font-size:17px">
<tr>
<th>test 1</th>
<th style='font-size:11px'><div>test 1.1</div><div style='font-size:22px'>test 1.2</div></th>
<th>test 2</th>
</tr>
</table>
</div>
Here is my jquery code but it will not work properly:
$(document).ready(function(){
$('.parent').find('*').each(function(){
curSize=$(this).css('font-size');
arrCurSize=curSize.toUpperCase().split("PX");
if(arrCurSize.length==2){
//alert(arrCurSize[0]);
$(this).css('font-size',((parseInt(arrCurSize[0])+2)+"PX"));
//alert($(this).css('font-size'));
}
});
})