<div class="all">
<span class="one"></span>
<span class="one"></span>
<span class="one"></span>
<span class="one"></span>
</div>
var price = $('.one').text();
$('.project_val').val(price);
<div class="all">
<span class="one">1</span>
<span class="one">2</span>
<span class="one">3</span>
<span class="one">4</span>
</div>
<input type="text" class="project_val" />
const spansWrapper = document.querySelector('.all');
const input = document.querySelector('.project_val');
const copyTextFromClickedSpanToInput = e => {
if (e.target.classList.contains('one')) {
input.value = e.target.innerText;
}
}
spansWrapper.addEventListener('click', e => copyTextFromClickedSpanToInput(e));