Created
August 23, 2017 16:19
-
-
Save iannase/c9b2ab0092d9cb5c74061e2b7506dd26 to your computer and use it in GitHub Desktop.
Jquery to convert usd to bitcoin as the user is typing. Uses an html input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#sc_uea_custom_amount_1').keyup(function(){ | |
var url = "https://blockchain.info/tobtc?currency=USD&value="; | |
var value = this.value; | |
var url2 = url + value; | |
$.get(url2, function(data){ | |
var returnText = '≈ ' + data + ' BTC'; | |
$('#input1').val(returnText); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how can i use it, can you give me a example ?