Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Changing the Font Size in an Alert box.
- From: javascript@xxxxxxxxxx (Steve)
- Subject: [Javascript] Changing the Font Size in an Alert box.
- Date: Wed, 27 Mar 2002 01:42:39 -0600
I've tried a lot of thing so as to change the font size
of an Alert box and got some strange results but I did
not succeed. How do you change the font size of an
alert box? Here is the code I working on:
<head><title>Decimal to Binary</title>
<script language="JavaScript1.3"
TYPE="text/javascript">
<!--
// Declare Global variable
var iNumber = 0;
var Quot = 0;
var Remainder = 0;
var Result = 0;
var stringBinary = new String(); // Creating a string
object
function convertDecimal(iNumber) {
for(var i = 1; i <= 32; i++) {
//if (iNumber == 0) { //Use this to elimate extra
zeros
//break;
//}
Remainder = iNumber % 2;
// Exp: 1 = 9 % 2
iNumber = (iNumber - Remainder) / 2;
// Exp: 4 = (9 - 1) / 2
if(Remainder == 0) {
stringBinary = "0" + stringBinary;
// The new binary number is con-
// cantanated to the left side of the
// string.
}
if(Remainder == 1) {
stringBinary = "1" + stringBinary;
}
} // This closes the For...Next loop
} // This closes the function
function processEntry(iNumber) {
iNumber = document.entryForm.numEntry.value
if(iNumber == 0) {
alert("A zero entry is not allow.");
} else {
convertDecimal(iNumber); // This passes the value of
x to iNumber
alert("The binary equivalent is: " + stringBinary);
// HERE IS THE ALERT BOX
}
}
// -->
</script>
</head>
<body>
<form name="entryForm">
<p>Enty a number no more than 5 digits in length:
<input type="text" name="numEntry" size="5"
maxlength="5" style="text-align: right;">
<input type="submit" name="process" value="Process"
onClick="processEntry(iNumber)"></p>
</form>
</body>
</html>
- Follow-Ups:
- Prev by Date: [Javascript] 包月长途电话(广告邮件不看请删除打搅了)
- Next by Date: [Javascript] how do I do event.clientX in Netscape?
- Previous by thread: [Javascript] 包月长途电话(广告邮件不看请删除打搅了)
- Next by thread: [Javascript] how do I do event.clientX in Netscape?
- Index(es):