14,662 questions
0
votes
4
answers
79
views
Button color-change on click, in React
I am trying to have a button to change its color when clicked in React.
I found this and tested it: https://reactgo.com/react-change-button-color-onclick/
The code being:
const [active, setActive] = ...
0
votes
1
answer
47
views
How to display 3 elements by 3 of an array in HTML using array.sclice() method in javascript
I have found a way to display a portion of an array using arrayName.slice(start, end), i made a funtion to feed the start and end to the slice method so i can use it with onClick button to click next ...
2
votes
1
answer
64
views
Drag and Drop Elements Independently in Vanilla JS
I'm new to Javascript, but getting close to finishing the vanilla JS for a mock desktop UI project: opening asides as "windows" that can be reordered, selected, and moved independently ...
0
votes
0
answers
38
views
button Element doesn't work on Iphones for some reason
I have tried to make something for Math class, however the button elements didn't seem to do anything on Iphones. I have tried to use eventlisteners and the onclick Attribute.
Does anyone know why it ...
1
vote
1
answer
39
views
Image alt captions showing as 'undefined' on modal image
I have mutiple art galleries on my website containing lots of images, I use an onclick event to pull up a full res, uncropped version of the image and it works perfectly fine. However, I want a unique ...
1
vote
1
answer
84
views
Why is my LazyColumn item's clickable modifier not working in Jetpack Compose?
I'm working on a Jetpack Compose app where I have a LazyColumn displaying a list of items. Each item is wrapped in a Surface with a clickable modifier, but clicking the items doesn't seem to work. I'...
0
votes
1
answer
26
views
How can I conditionaly remove the default behavior of an anchor (a) tag added by insertAdjacentHTML
I am trying to add an anchor tag that should redirect the user to another page only if a condition is met (here if array.length<3). I have followed Iananswer of this SO question, but in my case I ...
0
votes
4
answers
75
views
Combining 2 addEventListeners which do the same thing into 1
I would like clicking div-1 and div-2 to do the same thing but please how can I combine the 2 eventlisteners functions into 1
var div_1 = document.getElementById("div-1");
var div_2 = ...
0
votes
0
answers
30
views
Jetpack Compose: onClick working on device but not on emulator
Using the following function, The Toast and the Logcat output show when I run on a device, but not on emulators (I am using Pixel 5 API 33, Nexus 5 API 33, Pixel 3A API 33); using Android Studio ...
2
votes
3
answers
62
views
Run custom function before open in new tab
I am using an <a> tag instead of a button because I need to add the feature that allow user to right click and then open in new tab:
The issue right now is that this tag have an onClick ...
0
votes
1
answer
71
views
Execute the same javascript function from different onclick events [duplicate]
I have the following javascript code that plays a video when I click the "play" button in HTML.
How can I play different videos (multiple play buttons in HTML) without duplicating the ...
0
votes
1
answer
56
views
Responsive navbar click
I try to get my navbar responsive. Follow this tut on w3schools. If I copy and paste it is working, but I want it to be mobile first (media queries) and there is my problem.
The switch from mobile to ...
0
votes
0
answers
46
views
Tracking any Notification click on Android
I'm in the process of enhancing a legacy app that receives various types of notifications, such as those from Firebase, third-party software, and even some that we create ourselves.
The data analytics ...
0
votes
0
answers
33
views
Message set with "setError()" on a clickable TextView is not shown
I am not able to find the correct configuration for the behaviour I want. I have a layout with 2 TextView for displaying a date (birth and death date). To set both dates, the user touches (onClick() ...
0
votes
1
answer
50
views
Using a class to open same popup using document.querySelector
I have a popup login box on my site, I use <a class="logincontent">Login</a> which then calls up this function:
document.querySelector('a.logincontent').onclick = () => {
...