I need to apply css font-size by a jquery on click to every element under div selector. But I can't make them affect. This is how I tried.
CSS
#reading_pane{
font-size:14pt;
}
HTML
<div id="reading_pane">
<p>this is a text</p>
<span>this is another text</span>
</div>
<a id="incfont">A+</a>
<a id="decfont">A-</a>
javascript
$(document).ready(function() {
$('#incfont').click(function(){
curSize= parseInt($('#reading_pane span, p').css('font-size')) + 2;
if(curSize<=20)
$('#reading_pane').css('font-size', curSize);
});
$('#decfont').click(function(){
curSize= parseInt($('#reading_pane').css('font-size')) - 2;
if(curSize>=12)
$('#reading_pane').css('font-size', curSize);
});
});
As the detailed above. I need every <p> and <span> in div#reading_pane change the size on each a clicked.
<a id="incfont">A+</font> <a id="decfont">A-</font>correct ? I guess the closing tags should be</a>?