Reputation:
I have a input text like below
when I click inside that, one popup appear
that has two values like below:
<span id="btnSetMaxPrice" style="font-size: 11px" class="tp-co-gr digit tp-cu-po btnSetHighLow btnSetMaxPrice">70,465</span>
and when click on one of them then
in the input text, it writes that number
how can I do that?
Upvotes: 2
Views: 182
Reputation: 5004
You can read its textContent property.
console.log(document.getElementById('btnSetMaxPrice').textContent)
<span id="btnSetMaxPrice" style="font-size: 11px" class="tp-co-gr digit tp-cu-po btnSetHighLow btnSetMaxPrice">70,465</span>
Upvotes: 2