<input value="" class="item_count" min="0" pattern="[0-9]*">
<a style="cursor: pointer;" class="add_item" id="count_1" data-count="" >Добавить</a>
document.querySelector('.item_count').onchange = function(event){
document.querySelector('.add_item').setAttribute('data-count', event.target.value);
}