Jump to content


  • Content Count

  • Joined

  • Last visited

Posts posted by Stelian

  1. Hello, I am trying to make website with inclusive design for my homework and I have three functions that are changing the text size, text style and site color theme, but I can not save the changes after I reload the page.  This is my code for changing the text size:

    function size() {
      if (localStorage.getItem('z')=="1"){
        txt = document.getElementById("a").style.fontSize = "25px";
        else if (localStorage.getItem('z')=="2") {
          txt = document.getElementById("a").style.fontSize = "30px";
      else {
        txt = document.getElementById("a").style.fontSize = "20px";
    The code in my html is this:
    <body onload="size()">
    <button  type="button" onclick="size();">Change Text Size</button>
    <div  id='a'>Some text</div>
    I believe I can make the other two function save their changes If I see how to make this one.
    Thank you !
  • Create New...