user14939400
user14939400

Reputation:

how can I get text of popup in javaScript?

I have a input text like below

enter image description here

when I click inside that, one popup appear

enter image description here

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

Answers (1)

Aalexander
Aalexander

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

Related Questions