I want to create one(or two) button(s) to switch my theme from dark to bright, i didn't know anything about jquery but I read something in w3schools and other references so I wrote a Jquery function that change some properties in my css file:
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").css({
"color": "white",
});
$("div").css({
"background-color" : "black",});
});
});
</script>
I put this script in bottom of header tag in header.php file, and I add a button to the footer of site
<button class="bright">طرح روشن</button>
but when I click on the button nothings happen, when I try this code on w3shcools editor it works but the button in my wordpress site does nothing. here is my code in W3shcools editor:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").css({
"color": "white",
"background-color": "#98bf21",
"font-family": "Arial",
"font-size": "20px",
"padding": "5px"
});
});
});
</script>
</head>
<body>
<button>Set multiple CSS properties for all p elements</button>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
And if there is a way to call that function with "href" I will grateful to help me how can I call it.