Bitcoin Forum
May 22, 2024, 02:11:58 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [HTML Help] Change variable style  (Read 333 times)
Gary1973 (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
May 23, 2014, 09:17:16 PM
 #1

<input type="button" value="Generate quote" onclick="document.write( getQuote()  );" />

I know this will be a simple little thing but it's been pissing me off for about an hour now... How can I tell it to display my getQuote() variable in small bold text, by editing the above line?
wtfjusthappened
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
May 23, 2014, 11:45:12 PM
 #2

try this:

<input type="button" value="Generate quote" onclick="document.write('<b>' + getQuote() + '</b>' );" />



havent tested it but i think it will work
hyipworld
Full Member
***
Offline Offline

Activity: 233
Merit: 100


View Profile
May 24, 2014, 02:59:40 AM
 #3

I read this as name HTML HELP . we guys can use this thread like as a sharing of html knowledge with each others . we can talk here about all basic of html if you guys interested it is sure make our knowledge good . we can start this class from today !
Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
May 24, 2014, 07:35:49 AM
 #4

You need a place where it should write the quote to.

Code:
<html>
<body>
<style>
div { font-weight:bold; }
</style>
<script>
function getQuote() {
var quote = 'Random whatever: ' + Math.random();
document.getElementById('quote').innerHTML = quote;
}
</script>
<input type="button" value="Generate quote" onclick="getQuote()" />
<div id="quote"></div>
</body>
</html>
(dirty html)

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
Gary1973 (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
May 24, 2014, 10:51:29 AM
 #5

Cheesy Thank you guys - You've solved my issue!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!