0

JavaScript concept of "toggle" while doing nav Bar

I want to understand how to use js in oder to make my nav-menu responsive and interactive on mobile

9th Mar 2025, 11:29 PM
Ermias Kebede
Ermias Kebede - avatar
4 Answers
+ 2
toggle is basically just if else condition checking... pseudocode: using ternary expression: function toggle(){ el.property = el.property==this ? that : this } or using if-else: function toggle(){ if (el.property == this) el.property = that else el.property = this }
10th Mar 2025, 4:55 AM
Bob_Li
Bob_Li - avatar
+ 2
That's very cool understanding thanks
10th Mar 2025, 4:33 PM
Ermias Kebede
Ermias Kebede - avatar
0
How to create a Nar Bar
11th Mar 2025, 4:34 AM
Alesinladu Selim Olalekan
Alesinladu Selim Olalekan - avatar