Answer the question
In order to leave comments, you need to log in
How to make jQuery selector work?
The code doesn't work...
There is a div with id-orders, it has a table in react-e with id-table, it is necessary that after clicking on a row of the table, the code is executed. In the file it is written like this
$("#orders > #table > tbody > tr").click(function(){
console.log("работает");
});
Answer the question
In order to leave comments, you need to log in
Will not work because event delegation !
And anyway, why do you need jQuery in react? Do as react wants: In
general, such a record of selectors ("#orders > #table > tbody > tr") is a complete bad manners. All elements should have classes, especially those that you plan to click.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question