1
1
12332112020-09-17 13:49:23
JavaScript
1233211, 2020-09-17 13:49:23

How to call a function on a nested element?

How to call the onClick function? onFocus is called all the time.

<div onFocus={onFocus}>
   <input>
   <div onClick={onClick} />
</div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Loli E1ON, 2020-09-17
@1233211

<div onFocus={onFocus}>
   <input/>
   <div onClick={onClick}>клинки по мне</div>
</div>

K
Kirill Makarov, 2020-09-17
@kirbi1996

The div is not closed and the input in jsx is written differently

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question