search

Home  >  Q&A  >  body text

javascript - After clicking nav, using JS to add color, how can the changed color be maintained after the page jumps?

Each navigation page is the same piece of HTML linked through the background tag. After clicking the navigation, I change the color through js, but when I click to jump to a page, the color changed by js becomes invalid. How to solve this problem?

ringa_leeringa_lee2753 days ago1635

reply all(12)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 13:23:25

    What kind of demand is this? ? Against humanity

    reply
    0
  • PHPz

    PHPz2017-05-16 13:23:25

    You can use cookies or sessions

    srssion storage:

    localStorage.setItem('className', className)

    Read:

    var className = localStorage.getItem('className');

    reply
    0
  • Cancelreply