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"; } }

28th Jun 2020, 6:14 AM
Anish Ghimire
Anish Ghimire - avatar
3 Réponses
+ 1
Insted of - document.document.getElementById... Use - document.getElementById...
28th Jun 2020, 6:17 AM
Vishal Gupta
Vishal Gupta - avatar
+ 1
So can not be seen the relevant code sections. Please save your code in Playground and here a link.
28th Jun 2020, 7:18 AM
JaScript
JaScript - avatar
+ 1
Ja Play thanks for your help i had fixed it
28th Jun 2020, 7:21 AM
Anish Ghimire
Anish Ghimire - avatar