<script type="text/javascript">
var QofD = new Array(
'If it ain\'t broke. Get a bigger hammer.',
'Change is inevitable; progress is optional.',
'Do not attribute any action to malice that can be explained by stupidity.',
'The box said "Requires Windows 95, NT, or better", so I installed Linux.',
'You never get too old to learn a new way of being stupid!',
'If at first you don\'t succeed, you\'re running about average.',
'Mind over Matter: If you don\'t mind, it don\'t matter.',
'');
function setQofD() {
var r = Math.floor(Math.random()*(QofD.length-1));
document.getElementById('QOD').innerHTML = QofD[r];
}
</script>
</head>
<body onLoad="setQofD()">
<strong>Quote of the Day:</strong> <span id="QOD"></span>
<br />
</body>
</html>
Simplifies the code a bit for me, especially in the CSS section.
<script type="text/javascript" >
window.onload=function(){
var wch=(Math.floor(Math.random()*2)+1);
document.getElementById('ran'+wch).style.display='inline';
<span id="ran1">First Random Selection</span>
<span id="ran2">Second Random Selection</span>
and it worked with text.
But what will i have to do to insert div tags instead of text.
Instead of "First Random Selection" I want to insert
Bookmarks