Skip to content

Tag: html

Set img src without issuing a request

As part of building a code to copy and paste, we had to use a dom element that we appended text / other dom elements into it, and in the end the result would be code to copy. However, when appending image elements, the browser always issues a request for the image src. Is there any way around it? i.e.

hide sidebar when click anywhere in page

I have an animate sidebar which appears when user clicks on a hamburger button. Here is the structure : Actually we can open menu by clicking on #nav-toggle element and close it by clicking on this element too. I’d like to allow user to close this menu by clicking anywhere in the page. How can I do do t…

How do I tell if a user is using Brave as their browser?

I have been messing around with the Brave browser (https://www.brave.com/), an I cannot figure out how to determine how if a user is using Brave. I used a simple document to output the user agent: and I get: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 …