Hi everyone.
I grabbed this code from a javascript resource and I'm trying to tweak it to accomodate my text. Unfortunately, it doesn't work when I implement a css style. I need the css style implemented to maintain the visual continuity of the site. Anyhow here's the code:
--------------------------------------------------------
function GetRandom(start,end)
{
var range = end - start + 1;
var result = start + Math.floor(Math.random()*range);
return result;
}
</script>
<script language="JavaScript">
var choice = GetRandom(1,4);
if (choice==1)
document.write("<p class="heading">Broadband Store Grand Opening</p>"
;
else if (choice == 2)
document.write("<b>Tip:</b> Never spit into the wind."
;
else if (choice == 3)
document.write("<b>Tip:</b> Look before you leap."
;
else if (choice == 4)
document.write("<b>Tip:</b> Walk tall and carry a big stick."
;
</script>
---------------------------------------------------------
As you can see, I have a css in the first write command. If I remove the css so that it reflects the following write command it works. Any suggestions?
Thanks,
Dan
I grabbed this code from a javascript resource and I'm trying to tweak it to accomodate my text. Unfortunately, it doesn't work when I implement a css style. I need the css style implemented to maintain the visual continuity of the site. Anyhow here's the code:
--------------------------------------------------------
function GetRandom(start,end)
{
var range = end - start + 1;
var result = start + Math.floor(Math.random()*range);
return result;
}
</script>
<script language="JavaScript">
var choice = GetRandom(1,4);
if (choice==1)
document.write("<p class="heading">Broadband Store Grand Opening</p>"
else if (choice == 2)
document.write("<b>Tip:</b> Never spit into the wind."
else if (choice == 3)
document.write("<b>Tip:</b> Look before you leap."
else if (choice == 4)
document.write("<b>Tip:</b> Walk tall and carry a big stick."
</script>
---------------------------------------------------------
As you can see, I have a css in the first write command. If I remove the css so that it reflects the following write command it works. Any suggestions?
Thanks,
Dan