Questions tagged [onclick]
An event which occurs when user clicked an object. It is a combination of two events, that is, "onmousedown" and "onmouseup".
14,620
questions
0
votes
1
answer
18
views
How to trigger a span click event on an icon wrapped in a span?
I have a basic react ToggleBtn component that changes the up/down icon and triggers a modal. The button consists of text and an icon wrapped in a span. The problem is the event.target is different ...
0
votes
1
answer
29
views
How do you load a React component when Button is clicked?
I have a Nav bar button that when clicked opens a drawer that contains tabs explaining several products or solutions available. Currently the Navbar and Drawer are in one component to allow it to work ...
0
votes
1
answer
21
views
No click event on <option> in edge using jQuery
Just figured that there is no click event fired in MS Edge when clicking on a select option.
Here is the code using jQuery 1.9.1:
// data-hide - hide element in data-hide attribute onClick
$("[...
0
votes
4
answers
110
views
I'm unable to create an @onclick event in Blazor, following an ASP.NET tutorial [duplicate]
I'm following the ASP.NET tutorial on YouTube, and I'm having trouble creating an onclick event. I'm using Blazor and the following code is a Razor file. I'm using .NET 8.0 preview.
Image where code ...
0
votes
0
answers
34
views
How do I call a function onClick in NEXT 13 APP? [closed]
"use client";
const About = () => {
const handleClick = () => {
console.log("object");
};
return (
<section>
<div onClick={handleClick}>About&...
0
votes
3
answers
43
views
How to pass event args with an onclick in Blazor for the ID
I am trying to create a highlighted tab system in a Blazor app. Like how you would have an active nav component that is highlighted.
So when a button is clicked on, the background changes the colour ...
0
votes
1
answer
29
views
Trouble with a single click on my button. Click event working only for double click [duplicate]
I have some problems with click event. I'm new in javascript. When I click once, nothing happened, but for double click my event is working.
I'm tried figure out similar request from stackoverflow, ...
0
votes
1
answer
16
views
Problem with on click function addition inside the svelte code. I am trying to implement the annotations for a specific text on the front end
I am currently working on implementing annotations in the Svelte framework. You can see the data structure I am working with in the code below. The visualization is working perfectly, with the content ...
-2
votes
1
answer
27
views
Cannot set properties of undefined (setting 'onclick')
Getting error that onclick is applied on undefined, although i am passing the node element.
html
<div class="gallery">
<img src="image1.png" id="prdImg"...
0
votes
0
answers
7
views
How can i go to new component when a button is clicked but after some validations is done
I have a button that will send send otp and shows up a new screen where the user has to put the otp . But before that this buttton also calls a onClick function to validate the phone numbers.
I am ...
-1
votes
0
answers
18
views
C# must do specific task when I run it with shortcut [duplicate]
I have a programm written on c# in Visual Studio and I want it to do specific task when I run it with shortcut.
I don’t know how to create this method or maybe how named this event (when run with ...
-1
votes
1
answer
27
views
How to actually store an onclick function in localstore so it doesn't refresh all back to default
I want to change the currency of an existing products' prices that are in JOD (1 JOD = 1.41$ )
I did that using convertToUSD() function in Js, however, I couldn't save the changes, whenever I refresh ...
-1
votes
0
answers
35
views
Create c# method which include event on click desktop shortcut [closed]
I have a programm written on c# in Visual Studio and I want it to do specific task when I run it with shortcut.
I don’t know how to create this method or maybe how named this event (click desktop ...
0
votes
0
answers
21
views
Unexpected click event propagation to sibling when `label` parent contains `button` and `span` children [duplicate]
When a label element contains button and span children (all siblings), clicking the span unexpectedly also clicks the first button.
For example, here's a label that has 2 buttons and 2 spans as direct ...
0
votes
0
answers
17
views
Android: Java - implement Screenshot code to floating button
I have two programs which are working. But I need to implement screenshot function into floating button (second) code.
In the first there is made screenshot after button click:
MainActivity.java
...
0
votes
1
answer
23
views
Javascript error occurs when trying to click on a gridview row
I have added a click event to the rows of a devexpress gridview on the server-side (VB.net).
Protected Sub gvSubNotes_HtmlRowPrepared(sender As Object, e As ASPxGridViewTableRowEventArgs)
e.Row....
0
votes
1
answer
39
views
Selenium unable to find element that soup can so unable to click using python selenium and Beautiful soup
I am trying to click on a onclick item but Selenium doesn't find it.
Element is as follows.
<a tabindex="0" onkeypress="loginKeyboardEvent(event)" role="button" aria-...
0
votes
0
answers
21
views
issue with graphql-request react onClick handler
I am using graphql-request to execute a mutation in an onClick handler in a react application
The mutation executes successfully (I can verify by looking at the logs in the backend).
The code in ...
1
vote
2
answers
58
views
What is causing my javascript function to not run?
I'm trying to make a simple dress-up game with html and js, but I'm not sure why the function isn't working. The window onload event is being logged, but the makeupclass1 function is not doing ...
-1
votes
1
answer
49
views
Button OnClick - How do I Add Function?
I've been handed a task for developing a small code in which I am expected to make an adjustable ordered list. It needs to have a placeholder, where the lists items will be typed and added, a on click ...
0
votes
1
answer
32
views
Picking on subplots - unable to extract metadata
Apologies if I have some of the terminology wrong.
I am attempting to build a picker to allow me/ future users to slice a dataframe for a relatively large dataset (1000's of rows, 10's of cols).
...
-1
votes
0
answers
26
views
changing from input type to button for form submission
I have the following form which works fine:
<html:form action="userCreate.html">
<input type="hidden" name="meth" value="create" />
<table ...
0
votes
2
answers
46
views
How to Switch Picutres with Element ID (Javascript)?
I'm learning Javascript and don't understand why the following won't switch out when I reference the picture's ID. The URL works fine, but for simplicity and clarity's sake, I'd prefer to use the ID ...
-1
votes
0
answers
27
views
How to detect if mp4 video started playing?
I have a video with a button overlay and when the button is clicked, the video plays and the button successfully disappears. However there is a play option inside the actual video and when that is ...
0
votes
1
answer
112
views
Call method with onclick
I tried a lot already, would appreciate any help.
I built a state machine Dashboard with pytransitions and a dashboard with pywebio. Now im trying to have two buttons:
def btn_click(btn_val):
...
-1
votes
1
answer
29
views
Square button(x^2) exception handling error in Calculator android app development
I am currently trying to develop a Calculator android app in android studio using Java. The app works fine until I click the button for Square operation i.e. x^2 button in the app when there is no ...
0
votes
2
answers
46
views
playerSelection() is not returning but its getting passed a string value? [Rock paper scissors game]
Hello, i am currently revisiting a rock paper scissors game in html/css/javascript. Now i am trying to make a corresponding website where you can click the button and it logs your playerChoice in that ...
0
votes
0
answers
17
views
Problems printing data generated by a for loop, python [duplicate]
I have a problem with the following part of my code, I have a function that is responsible for generating several containers where data such as the name and surname of the people are located, and also ...
0
votes
1
answer
24
views
How do I create multiple video popups with Javascript?
The following is the code: There are two video links that pop up in the same video. How do I add a second video so that when I click on the bottom link the second video will pop up?
I think that I ...
0
votes
2
answers
46
views
Saving data to database and conditional rendering in react
I am having trouble saving data to a database and then conditionally rendering the components in react.
I want to display a message box, save the message to a database, and then remove the message box ...
0
votes
2
answers
35
views
React Error: 'obj' is not defined.eslint no-undef
In React I have RecipeListPage.jsx with recipes. Clicking on a recipe should show RecipePage.jsx with only the clicked recipe info. However, my onClick code gives the error 'obj' is not defined....
0
votes
2
answers
47
views
How to capture on click in mesh three.js in autodesk viewer?
I have this spheres marked in a Revit model, and i basically want to capture the click on them and show it's details.
I followed this question: How to add event for a mesh in threejs?, but, when I ...
0
votes
0
answers
8
views
a link within a link - how to notice an inner click
I have code that goes something like this:
<a href="" onclick=count() >
<div>
// user content goes here inside
// the div, including links
<a href="" onclick=oops() &...
1
vote
2
answers
161
views
NextJS 13: does not work onClick but the component uses 'use client;'
I try to implement the select component. However, I noticed that my onClick function did not work. I don't know why, because I used 'use client;' for my component.
"use client";
import React ...
0
votes
1
answer
23
views
React event handler not removing object from array of objects (useState)
I am trying to make a playlist app where you can use the search results to create your own playlist. Ive successfully been able to pass the songs from my search results to the playlist but when I try ...
0
votes
1
answer
45
views
Why can't I access the key values in my array of objects in React
I am trying to create an app where you can go through a list of recipes and click a recipe to add it to your list of favorites. Currently my app is creating a new card but the card has none of the ...
0
votes
2
answers
43
views
change color of background and text with javascript
I want to keep it simple on my simple html page. 1 button to cycle background colors, 1 button to cycle text colors.
I found some code here on stackoverflow that works, for the background:
<script&...
0
votes
1
answer
18
views
How can I redirect user from 1st component to second component using onclick function
import React from 'react'
import { useNavigate } from 'react-router-dom'
import user from './api/Userdata'
import InsideChat from './InsideChat'
const Chats = () => {
const seeMsg = (id) => {
/...
0
votes
1
answer
34
views
Onclick function not working in element which is inside map function [duplicate]
import React from 'react'
import user from './api/Userdata'
const Chats = () => {
const seeMsg = (id) => {
console.log(id)
}
return (
<div className="main">
...
0
votes
0
answers
59
views
Conditional Rendering of Parallel Next.js Routes onClick in Layout.jsx
I'm facing an issue with conditionally rendering parallel routes in a Next.js application. I have two parallel routes, @home and @signin, each associated with its respective content. I'm trying to ...
0
votes
2
answers
33
views
How to fix timer and color change on click Flutter?
I am trying to create simple test, where if user clicks on the right answer, button background changes to green and stays green for 3 seconds.
I implemented set state with timer, but the background ...
0
votes
0
answers
10
views
Button isn't calling javascript function on click
I made a button in html and used onclick to trigger a javascript function, but it isn't being called.
<button type="button" onclick="openNav()"><img src="hamburger....
0
votes
1
answer
21
views
React useState not updating onclick event with <Link>
I unable to update the state of the variable in ReactJS on click of . It's works fine without route but when I add to="/myUrl" It isn't working below is my code
const [pageTitle, ...
0
votes
2
answers
31
views
OnClick event prevent opening when closed
I got this OnClick:
const [open, setOpen] = useState(true);
and
onClick={() => setOpen(!open != true)}
Aim is to "when open then close" and "when closed then remain closed". ...
2
votes
0
answers
25
views
My onClick callback seems to be out of sync with my POST request
Hopefully I can explain the issue I'm having.
I have a button that triggers a callback function to initiate a POST request, aiming to save favorite job posts. The endpoint for this request is ...
0
votes
1
answer
37
views
Call Function in Dynamic HTML String
I have a structure in my application where I generate dynamic html. I add an html member in each user action and this member has buttons. I want to assign my defined function to the (onclick) action ...
0
votes
2
answers
34
views
android data binding error using listener binding
I'm binding a listener in my View model to the on-click of a FAB in my fragment xml.
My fragment xml showing the FAB.
<data>
<variable
name="vehicleViewModel"
...
0
votes
1
answer
13
views
Modal Close Function not working when im click the close button
const [modalOpen, setModalOpen] = useState(false);
const openModal= ()=>{
setModalOpen(true);
}
const closeModal = () => {
setModalOpen(false);
};
...
0
votes
1
answer
34
views
How to make SVG rotate 360° on click, like on chrome://settings?
How can this be roleized with SVG? I would be very grateful if you could help, thank you.
HTML
<svg id="product-logo" on-click="onProductLogoClick_" width="27" height=&...
0
votes
1
answer
17
views
how to find value of "aria-expanded"
I want to grab the value of aria expanded in form below when click on div with class dropdown-sort
<div class="dropdown dropdown-sort open" style="flex-grow: 0;">
<...