hi i have this html code
<div class='moves'>
<div class='element'><input type='text' value='55' /></div>
<input class='top' type='text' />
<input class='Bottom' type='text' />
<input class='left' type='text' />
<input class='right' type='text' />
</div>
<div class='moves'>
<div class='element'><input type='text' value='55' /></div>
<input class='top' type='text' />
<input class='Bottom' type='text' />
<input class='left' type='text' />
<input class='right' type='text' />
</div>
<div class='moves'>
<div class='element'><input type='text' value='55' /></div>
<input class='top' type='text' />
<input class='Bottom' type='text' />
<input class='left' type='text' />
<input class='right' type='text' />
</div>
now what i want is when someone keyup inside top or bottom or left or right classes change the div at same parent position to the values or top left buttom right ect so i tried this
$(".top").keyup(function(){
var element = $(this).parent().closest('.element');
console.log(element);
})
i gat this message
w.fn.init [prevObject: w.fn.init(1)]
but what i want is to change position to the input with value 55 thanks a lot
var element = $(this).siblings('.element');orvar element = $(this).parent().find('.element');orvar element = $(this).prevAll('.element');