Bitcoin Forum

Other => Off-topic => Topic started by: Gary1973 on May 23, 2014, 09:17:16 PM



Title: [HTML Help] Change variable style
Post by: Gary1973 on May 23, 2014, 09:17:16 PM
<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?


Title: Re: [HTML Help] Change variable style
Post by: wtfjusthappened on May 23, 2014, 11:45:12 PM
try this:

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



havent tested it but i think it will work


Title: Re: [HTML Help] Change variable style
Post by: hyipworld on May 24, 2014, 02:59:40 AM
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 !


Title: Re: [HTML Help] Change variable style
Post by: Bitsky on May 24, 2014, 07:35:49 AM
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)


Title: Re: [HTML Help] Change variable style
Post by: Gary1973 on May 24, 2014, 10:51:29 AM
:D Thank you guys - You've solved my issue!