0
That is JavaScript QUESTION.
Hi everyone. I created a function which is going to open and close the Menubar but every Time as i run the code, i received an error like "Uncaught TypeError: Cannot read property 'style' of null". I could not analyze the error can someone take a look on my code and help me with that? Thanks
14 Respuestas
+ 4
Ahmad something like this?
https://code.sololearn.com/W0d2w3vQCCNR/?ref=app
+ 6
Ahmad Hi, please post your code.
+ 5
Ahmad great, if it's correct then mark this answer as best (green tick) to prevent others work on solved solution.
Also, please don't use margins, use .style.display instead :)
+ 1
That is the Link Adress: https://code.sololearn.com/WPKK0kZp0odL/#
+ 1
Hi Coder. Thanks for Answer. I did the same as you mentioned but still, i have the same problem. I stuck till now with the same problem.
+ 1
Thanks Dear r8w9 That is a great answere🙏✌👏if you some solution that i can do it with margin, please share me. thanks
+ 1
Thanks dear r8w9 fot your cooperation i did it✅
0
Dear thanks for your response, i did it but i recieved another error which is not define the menuToggle in arrow function as i define it i recieve another error. which say Malformed arrow function parameter list
0
HI Bono. unfortunately, it does not work for me, i mean when the window loaded the list is not going to be clear on the website, when i click the menu it has to be closed and open the list. That is the reason that i defined the marginRight = "-300px";
0
Hi CODER: As you see in the HTML File, I have the Link tag which takes the Menu and i have as also a list inside the HTML File. i styled it simple in the CSS File. i wrote the JS code to change the style and the behavior of the List. As the browser will load, the List should be closed or unvisible. As i click the Menu it should open the List according to the width = 300px; as i click it again it should close or be unvisible(That is the reason which i define the marginRight = " - 300px";)