• I have an interesting dilemma with trying to use JavaScript.

    Website and post: https://www.lambdachi.org/candc/chapter-news-december-2011

    On this page, I have a <select> menu that will jump to the chapter when it uses onchange (I’ve severely cut down the list so you get my point):

    Jump to chapter: <select onchange='location.hash=this.options[this.selectedIndex].value;'>
    <option value='Alabama (Alpha-Phi)'>Alabama (Alpha-Phi)</option>
    <option value='Alberta (Epsilon-Rho) '>Alberta (Epsilon-Rho)</option>
    <option value='Arkansas (Gamma-Chi) '>Arkansas (Gamma-Chi)</option>
    </select>

    The problem is that WordPress continually strips out the onchange part of the code. This is a standard function with it, so I don’t quite understand.

    I’ve read that I need to put it into the PHP-side, but it is on so few pages that I wouldn’t want to change a template in WordPress. Does anyone have any ideas as to keep this bit of code in there?

    Thanks in advance!

  • The topic ‘onchange JavaScript keeps getting stripped’ is closed to new replies.