Skip to content

open/close sidebar changing buttons

it says me -> Uncaught TypeError: document.getElementById(…) is null Answer document.getElementById does not target a node by its class=”” but by its id=”” To target an element by its class you can use document.querySelector

Binding touch and scroll to wheel event

I have this code for vehicle to horizontal and back to vertical scrolling, however it only works on mouse wheel scroll. I also need it to respond accordingly to mobile touch, scrollbars, page up/down, and the keyboard arrow keys. Below is my code: How can I make this work for mobile touch, scroll bar, arrow k…

How to add the option to allow only one space in a regex

I want a regex that will allow only one space within a set of characters. I have the below regex which doesn’t accept space. The below regex only supports strings like 1. @alia 2. @ranbir 3. @shilpa I want a regex that will allow strings like 1. @alia bhat 2. @ranbir kapoor 3. @shilpa shetty Answer You …

Change active class when a menu item is clicked

I’m trying to change the active class when I click one of the items in the menu, but how do I change the color on selected tab to another active tab and then remove the old one? Answer You would wanna use JavaScript to achieve this. Like so:

Set checkbox selected in Vue

I am beginner in vue and web developing. I make my app with Laravel and Vue. I have this code: This code show me inputs – and it’s work fine. I have problem with set selected attribute for selected checkbox. In array selectedDocumentDircionary results from api: How can I set checked for only this …