Skip to content

Tag: javascript

Unexpected token ‘export’ in lodash-es

I move from lodash to lodash-es in my typescript project . I installed lodash-es and @types/lodash-es. But when I compile using webpack my project it throw an error: I’m not sure what the problem and how to solve this error? Answer From your error, looks like you are trying to load a esm module in node …

Enabling 4-digit pincode autofill using cookies

I have a simple form where one needs to enter a 4-digit PIN code. However, I would also like to autofill that PIN code when the user comes back to the website again, using JS cookies. JS: HTML: I’m aware of a few things that are wrong about this code. in the checkCookie() function, if the user has a coo…

Close Dropdown when other Dropdown is toggled active

i am trying to close let´s say Dropdown A automatically, when Dropdown B gets classList.toggle(“active) (in this case i toggle the ClassList with a Click) I can open (classList.toggle(“active)) and close (classList.toggle(“inactive)) it manually, but i want to close it automatically. Right n…

Using a variable to for loop using django

I’m very new to python and django framework. I’m facing a minor issue of not being able to assign a variable to my for loop. In my html file there are buttons and a list (rendered using a loop). for ex: Buttons Inside script tags i’m updating the variable value as Also i have a loop like fol…