WordPress jquery problem
-
Hi all
I have a super simple WP site here as a demo
https://www.ttmt.org.uk/forum/wordpress
It’s a header.php, footer.php, index.php and page.php.
I have one page with a title of Page that uses page.php as it’s template. The header list the pages so has ‘Page’ in the header.
Page.php simple has <h4 id=”oneBtn”>Red</h4>
In header.php I have this jquery to change the color of #oneBtn on Page.php when the button in the header in clicked.
<script type="text/javascript"> $(document).ready(function(){ $('#nav li a').click(function(){ $('#oneBtn').css('color','red'); }); }); </script>
This doesn’t work and I can’t see why.
Once the page has loaded and the Page button in the header is clicked again the ‘Red’ text flashes red then returns to black.
Can anyone explain why the text in the page won’t stay red.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘WordPress jquery problem’ is closed to new replies.