Trying to add some javascript in a Wordpress DIVI page. I don't understand why the display property of my html elements is not defined as "None"... So it never goes in the "if" statement...
2 buttons /2 Rows / Hide and show function.
When debugging the JS in the developper console, I can see the property is "Block". But the element are clearly hidden on the front and display property is "none".
URL of the page : https://www.mindyourcash.fr/club-option-invest-panel/
CSS
#playlistyt,#downloadsrow
{
display:none;
}
HTML
<button onclick="ShowForum()">Forum</button>
<button onclick="ShowVideos()">Vidéos</button>
JS
<script>
function ShowForum() {
var forum = document.getElementById('forumrow');
var video = document.getElementById('playlistyt');
if (forum.style.display === "none") {
forum.style.display = "block";
video.style.display="none";
}
}
function ShowVideos() {
var forum = document.getElementById("forumrow");
var video = document.getElementById("playlistyt");
if (video.style.display === "none") {
video.style.display="block";
forum.style.display = "none";
}
}
</script>
Thank you