I'm currently trying to associate a click to a right arrow press in a Web application. The thing I have here is working, but pops me every single '.t-input' in my page every single time I click my button. I'm currently using this code :
comboboxArrowDown.onclick = function () {
var e = jQuery.Event("keydown");
e.which = 39; // Key arrow right = 39
$('.t-input').trigger(e);
}
I think you are mixing pure javascript and jQuery.
span with and id="a",
#a
which contain a div called class="b"
.b
, which contain another div called class="c"
.c
, and then my input
.t-input
$("#a > .b > .c > .t-input")
This will get all the objects with class .t-input INSIDE .c INSIDE .b INSIDE the element with id #a
The other answers given will surely get you the same result, but the b could be inside the c or the c inside the b.