Moving elements with JavaScript
Recently I had a situation where there were two elements, A and B, each of which contained a whole load of things. On mobile A was at the top and B was below it. But on desktop B was on the left and A
Search for a command to run...
Articles tagged with #javascript
Recently I had a situation where there were two elements, A and B, each of which contained a whole load of things. On mobile A was at the top and B was below it. But on desktop B was on the left and A
If you have a modal then when people are tabbing through the links/buttons/forms etc inside them then you want to be sure that they can't tab off the modal. Generally speaking your modal will hide the content behind it, so anyone using a keyboard and...
Murdle is one of the many Wordle-like daily games. But it's not about words, it's about solving murder mysteries using a logic puzzle. Which are two of my favourite things. The one thing I don't like about the game is that when I pick a card up, I wa...
I haven't used the MutationObserver often, but it's been so useful when I do. What it does is to watches for changes in the HTML of a page and once you've found them, you can then do something. For example, you can watch for a class being added to or...
I hate adding elements to the DOM using JavaScript. This is because it's really easy with jQuery, something I have to look up every time in JavaScript, and really easy in React. I pretty much learnt React to avoid doing it in JavaScript. But I though...
Let's say you have an array of arrays like this: [ ['one', 1], ['two', 2], ['three', 3] ] and what you want are two arrays that are: ['one', 'two', 'three'] [1, 2, 3] How do you do that? Array looping - maps and filters All you have to do is to loop ...