I'm very new to JavaScript and jQuery. However, I've jumped into trying to make inline edit for my wp_list_table
but find it difficult to catch the class for some reason.
The classes for the column I'm trying to catch is named
<td class="director column-director">
I've tried the 2 following statements below to check that I actually catch the class correctly:
$( ".director").click(function() {
alert( "Handler for .click() called." );
});
$( ".director", '.column-director' ).click(function() {
alert( "Handler for .click() called." );
});
The console shows no errors and nothing is happening when I click the <td>
.
Is there anyone that can tell me what I'm doing wrong?
I'm very new to JavaScript and jQuery. However, I've jumped into trying to make inline edit for my wp_list_table
but find it difficult to catch the class for some reason.
The classes for the column I'm trying to catch is named
<td class="director column-director">
I've tried the 2 following statements below to check that I actually catch the class correctly:
$( ".director").click(function() {
alert( "Handler for .click() called." );
});
$( ".director", '.column-director' ).click(function() {
alert( "Handler for .click() called." );
});
The console shows no errors and nothing is happening when I click the <td>
.
Is there anyone that can tell me what I'm doing wrong?
1 Answer
Reset to default 1Replace $( ".director", '.column-director' )
by $( ".director, .column-director")
and also replace $
by jQuery
$( ".director", '.column-director' )
by$( ".director, .column-director")
– Karun Commented Jun 29, 2015 at 9:35$
byjQuery
– Karun Commented Jun 29, 2015 at 9:40