0
whats wrong in this code
var menuBtn = document.document.getElementById("menuBtn"); var sideNav = document.document.getElementById("sideNav"); sideNav.style.right = "-250px"; menuBtn.onrclick = function() { // body... if (sideNav.style.right == "-250px") { sideNav.style.right = "0"; } else{ sideNav.style.right = "-250px"; } }
3 Réponses
+ 1
Insted of -
document.document.getElementById...
Use -
document.getElementById...
+ 1
So can not be seen the relevant code sections. Please save your code in Playground and here a link.
+ 1
Ja Play thanks for your help i had fixed it