The jQuery code looks like this and works fine (probably it look a bit sorter, so please let me know and I’ll change it either): jsFiddle
jQuery:
$('.inputs').on('keyup',function(){
$(this).parent().not(this).find('.inputs').val($(this).val());
}
);
HTML:
<div>
<input type="text" class="inputs" value="hello">
<input type="text" class="inputs" value="John">
</div>
How can I rewrite this code for knockout.js?
Thank you.
Take a look at the below code snippet which will work fine with ko.
Hope, You will do this with more data. In that case, Take a look at this sample which will let you know about how to support more data.
For more faqs visit jqfaq.com