I have a problem with the this element (I know how this is working).
this
I have a lot of that html structure. When I click on the a button, the
The this element represents the element that invoked the action witch in your case, it's the element.
and it seams you want to only show, the next and not all of them, so you need to think like this: In this code, if what fires the click is the (your selector), how do I go to reach the I want to show? Toevoegen text From you can navigate to the previous element, witch is the and the next element (the ) is the one I want... translating this to code: var extraOptions = $(this) // my element .prev() // previous element () .next(); // next element from is you can always make more generic so you can safely add more elements in between, for example: instead of calling the .prev() (previous element), find the closest elemnt with a class of actions and from there, find the next element down the DOM with a class of extra-options-tickets, translating: var extraOptions = $(this).closest(".actions").next(".extra-options-tickets"); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
and not all of them, so you need to think like this: In this code, if what fires the click is the (your selector), how do I go to reach the I want to show? Toevoegen text From you can navigate to the previous element, witch is the and the next element (the ) is the one I want... translating this to code: var extraOptions = $(this) // my element .prev() // previous element () .next(); // next element from is you can always make more generic so you can safely add more elements in between, for example: instead of calling the .prev() (previous element), find the closest elemnt with a class of actions and from there, find the next element down the DOM with a class of extra-options-tickets, translating: var extraOptions = $(this).closest(".actions").next(".extra-options-tickets"); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
In this code, if what fires the click is the (your selector), how do I go to reach the I want to show? Toevoegen text From you can navigate to the previous element, witch is the and the next element (the ) is the one I want... translating this to code: var extraOptions = $(this) // my element .prev() // previous element () .next(); // next element from is you can always make more generic so you can safely add more elements in between, for example: instead of calling the .prev() (previous element), find the closest elemnt with a class of actions and from there, find the next element down the DOM with a class of extra-options-tickets, translating: var extraOptions = $(this).closest(".actions").next(".extra-options-tickets"); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
click
I want to show? Toevoegen text From you can navigate to the previous element, witch is the and the next element (the ) is the one I want... translating this to code: var extraOptions = $(this) // my element .prev() // previous element () .next(); // next element from is you can always make more generic so you can safely add more elements in between, for example: instead of calling the .prev() (previous element), find the closest elemnt with a class of actions and from there, find the next element down the DOM with a class of extra-options-tickets, translating: var extraOptions = $(this).closest(".actions").next(".extra-options-tickets"); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
Toevoegen text
Toevoegen
From you can navigate to the previous element, witch is the and the next element (the ) is the one I want... translating this to code: var extraOptions = $(this) // my element .prev() // previous element () .next(); // next element from is you can always make more generic so you can safely add more elements in between, for example: instead of calling the .prev() (previous element), find the closest elemnt with a class of actions and from there, find the next element down the DOM with a class of extra-options-tickets, translating: var extraOptions = $(this).closest(".actions").next(".extra-options-tickets"); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
) is the one I want... translating this to code: var extraOptions = $(this) // my element .prev() // previous element () .next(); // next element from is you can always make more generic so you can safely add more elements in between, for example: instead of calling the .prev() (previous element), find the closest elemnt with a class of actions and from there, find the next element down the DOM with a class of extra-options-tickets, translating: var extraOptions = $(this).closest(".actions").next(".extra-options-tickets"); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
translating this to code:
var extraOptions = $(this) // my element .prev() // previous element () .next(); // next element from is you can always make more generic so you can safely add more elements in between, for example: instead of calling the .prev() (previous element), find the closest elemnt with a class of actions and from there, find the next element down the DOM with a class of extra-options-tickets, translating: var extraOptions = $(this).closest(".actions").next(".extra-options-tickets"); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
) .next(); // next element from
is
you can always make more generic so you can safely add more elements in between, for example:
instead of calling the .prev() (previous element), find the closest elemnt with a class of actions and from there, find the next element down the DOM with a class of extra-options-tickets, translating:
.prev()
actions
extra-options-tickets
var extraOptions = $(this).closest(".actions").next(".extra-options-tickets");