javascript - change text-font size of whole page content -
is there way in javascript/css can change text size of labels, headings, paragraphs etc on single click , without explicitly getting element's id , changing font size.
what doing right element's id through javascript , change font size explicitly. clear picture of doing check link or check following code
<script type="text/javascript"> function changemysize(myvalue) { var div = document.getelementbyid("mymain"); div.style.fontsize = myvalue + "px"; } </script>
html code
choose text size: <font size="2"><a href="javascript:void(0);" onclick="changemysize(16);">a</a></font> <font size="4"><a href="javascript:void(0);" onclick="changemysize(20);">a</a></font> <font size="5"><a href="javascript:void(0);" onclick="changemysize(25);">a</a></font> <div id="mymain"> text gets affected </div>
add id body
tag , go ahead , change it's font size javascript. change font size every element inside webpage! simple that!
Comments
Post a Comment