How to use bitcoin price as place holder in php?

0 votes

I am loading the current bitcoin price to my webpage using:

var auto_refresh = setInterval(

     function()

     {$('.btc-price').load('gox.php');}, 10000);

I can get the current price to display with:

<div class="btc-price"></div>

Now, I want to use the price as a 'placeholder' in an input field:


<input placeholder="[current bitcoin price here]" />

But it does not work. How to do this?

Aug 21, 2018 in Blockchain by slayer
• 29,170 points
44 views

1 answer to this question.

0 votes

You can do it by providing an id to your input field and then set the attribute placeholder through jquery.

Example:

var auto_refresh = setInterval(

     function()

     {$.get('gox.php', function (data) {

          $("#inputid").attr('placeholder', data);

     });}, 10000);
answered Aug 21, 2018 by digger
• 26,550 points

Related Questions In Blockchain

0 votes
1 answer

How to create Bitcoin Address in PHP?

You need to understand that Bitcoin address and ...READ MORE

answered Aug 27, 2018 in Blockchain by Perry
• 17,020 points
509 views
0 votes
1 answer

How to use real world/live data in my smart contract?

You cant access/embed real world data using ...READ MORE

answered Jul 12, 2018 in Blockchain by digger
• 26,550 points
59 views
0 votes
1 answer

How to add Bitcoin as currency for my website?

You cannot use BTC as the currency ...READ MORE

answered Aug 17, 2018 in Blockchain by slayer
• 29,170 points
50 views
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,340 points
81 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
157 views
0 votes
1 answer
0 votes
1 answer

How i can use nodejs to watch transactions in bitcoin network?

you can use  const Socket = require('blockchain.info/Socket'); const mySocket ...READ MORE

answered Jul 9, 2018 in Blockchain by digger
• 26,550 points
50 views
0 votes
2 answers