i need a script that will output - text to a webpage 1/2 the time- then a different text the other half, Can anyone help with that, Thanks
<html> <head> <script type="text/javascript"> function randomText() { var x = Math.random(); if (x < 0.5) document.getElementById("random").innerHTML = "Text One" else document.getElementById("random").innerHTML = "Text Two"; } </script> </head> <body onload="randomText()"> <span id="random"></span> </form> </body> </html> Code (markup): But you often get the same text several times in a row. That's unavoidable unless you have some way of storing the previous text, like with a cookie.