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,370 points
923 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,740 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 28, 2018 in Blockchain by Perry
• 17,100 points
5,451 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,740 points
1,135 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,370 points
1,056 views
+1 vote
1 answer

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

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,426 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
1,922 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
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,740 points
1,281 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP