K
K
kpa182021-02-19 13:58:31
JavaScript
kpa18, 2021-02-19 13:58:31

How to parse value from json and display it in html element?

Good afternoon, there is a coindesk api that passes the btc price value: https://api.coindesk.com/v1/bpi/currentprice.json
I need to display the USD price value in a div element:

<div class="input-group mb-3">
                    	<div class="input-group-prepend">
                      	<span class="input-group-text">Price</span>
                    	</div>
                    	<input type="text" class="form-control" placeholder="Цена из json" readonly>
                    	<div class="input-group-append">
                     	 	<span class="input-group-text">USD</span>
                    	</div>
                  </div>

How can this be implemented?
I haven't worked with json before. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Melnikov, 2021-02-19
@mlnkv

https://jsbin.com/mupipad/edit?js,output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question