October 9th, 2012, 07:44 AM
Document.write a new array element by button
I am a proper beginner so please bear with me. I have a webpage which prints out a random element from an array when the page loads and that works.
What I would like is to have a button on my website which will document.write a random element from an array when I press it but without reloading the page. I can get it to work by calling the function which document.write a random element from the array but this prints out on a new webpage and everything else is gone...
Can someone show me how I can do this?
Thanks very much.
October 9th, 2012, 07:59 AM
Welcome to DevShed, sitefinder.
Can you post what you have at the moment?
October 9th, 2012, 08:52 AM