javascript - Selector returns undefined -


html

<form method="post">     {% csrf_token %}     <tr id = "{{ x.id }}">         <td>{{ x.name }}</td>         <td>{{ x.sth }}</td>         <td>{{ x.sth_else }}</td>         <td><button type="submit" name="edit_btn">edit</button></td>     </tr> </form> 

jquery

$('form').on('submit', function(event){     event.preventdefault();     console.log("executing script edit button pressing")     x = $(this).children().first().attr('id');     console.log(x) }); 

i'm trying extract id tr in html, whenever on page , see console output get: undefined. ideas?


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -