D
D
Denioo2020-06-19 20:47:08
JavaScript
Denioo, 2020-06-19 20:47:08

How to catch button click on input?

Is it possible to somehow catch the mouse button click on the input and turn on the function? @click is obviously not suitable for these purposes (

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kovalsky, 2020-06-19
@Denioo

What does "doesn't fit" mean ? Everything seems to be working

B
b_deppo, 2020-06-19
@b_deppo

In React, for example, there is onChange where you can pass an arrow function and describe an event of this kind there as event.target.value

N
Nadim Zakirov, 2020-06-19
@zkrvndm

If we are talking about the mouse button, then try this:

<input type="text" onmousedown="alert('Кликнуто поле!');" placeholder="Кликни меня">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question