I want to do something that seems simple enough, yet I am struggling quite a lot (I am new to Javascript).
I want to get the value from this page https://blockchain.info/q/24hrprice (bitcoin api for today's price). I want to put this in a javascript variable and then display it on my web page.
Here's what I got so far:
<input type="text" id="mytext">
<script>
var test = $.getJSON("https://blockchain.info/q/24hrprice");
var todayvalue = test.done(function(response) { console.log(response); });
document.getElementById("mytext").value = todayvalue;
</script>
If I check my console, the value is found and there is no error message but all I get on my web page is a box with [object Object] and nothing in it.
Do you guys know what I am doing wrong?
Thanks a bunch