I’m trying to make a captcha verification system for my discord bot. So when someone join a server the bot will DM the user a captcha and the user have to solve the captcha in a given time period to get a specific role in the server but my bot doesn’t seem to collect the user’s message. I…
Tag: javascript
remove active class by scrolling in android
I would like to ask how can I remove active class when scrolling? Everything works fine on desktop size, it removes the active class when I’m scrolling, even if I click on any nav menu, when I’m continue scrolling it removes the active class from that nav menu. But it gets weird on mobile device, …
How to get a value in a JavaScript object by key
I have object and I would like to get the value of the id somehow by providing type = “EXTRA”. Could someone help with this? Answer Your array You can use the find() method for what you need providing the ‘EXTRA’ value of type Your Output https://jsfiddle.net/kenpy/1moru9y4/9/
Fire only when clicking on parent element JavaScript
I have 2 collapsible nested inside each other When clicking on Test 7, it closes both the BRAND and test 7 accordions I have this JavaScript code where “mobile-nav_accordion-contentbox” is the className of the parent element (BRAND) Solutions I tried: Adding e.stopPropagation(); inside the click e…
How to target selected radio buttons?
Below is my code and I am getting movies data from an API and I am creating different elements using Javascript create Element like title, rating and favorite radio button for selecting favorite movies now I wonder how to target all the selected radio buttons because I have generated radio buttons dynamically…
Text and emoji extraction from HTML
I need to perform text and emoji extraction from HTML (I have no control over the HTML I get). I found it fairly simple to remove HTML tags using the following function; however, it strips out the emojis embedded within an <img> tag. The result should be plain text + emoji characters. I don’t care…
How can i add a url image in my function for each switch case?
How can I add a url image in my function for each switch case? (so that the image displays inside the mybox div along with the text on button click) Answer The code below should help you. Have a look at the following line: When running the code snippet below, you should wait a few seconds for the image to
Eval Javascript string and store stdout
I get Js as a string and I need to execute that script and compare the output to something. I’m using eval() here but can be anything. It runs on client side in the browser. Is there any way to do this without changing the string a? Answer Using: bind() call() you can extend console.log so that an addit…
How to create ActionFilter in Javascript?
I understand that there is a concept of Action Filters in languages like C# using ASP.NET. I would like to have this kind of pre-processing functionality in my class methods, using Javascript. Is this possible/a part of the language? Otherwise how would I implement this feature? It sounds like a language leve…
vue js ARRAY push
I have an array(rows) inside an array(tabs). I want to duplicate the the array. now how do I duplicate the rows array and tabs array separately. Like when I click “Add row” button a row will be added and when I click the “add tab” button the whole tab with row will be added. I am tryin…