/    Sign up×
Community /Pin to ProfileBookmark

Want to change the text in div on every refresh of the page

Hi All,

I am creating website using Html and Css and want to show the section like “recent articles” with changing text on every refresh of the page. I am new to java script and i am unable to do it. Please help me.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@shashankssssauthorDec 14.2012 — Also during search I found this link http://wsabstract.com/script/script2/motivatequotes.shtml

But I don't know if it the the right way and how to show hyperlink in spite of text.
Copy linkTweet thisAlerts:
@thewebtaylorDec 14.2012 — This thread should give you the code you need, it's fairly simple to do... http://www.dynamicdrive.com/forums/showthread.php?45102-Customizing-a-random-quote-script
Copy linkTweet thisAlerts:
@shashankssssauthorDec 14.2012 — Thanks for the link thewebtaylor. One more thing out of this script if I want to show different hyperlinks for every line (like different hyperlink text for quotes[0],quotes[1]....), please let me know how it's possible?

var say = new Array();

quotes[0] = " Welcome8";

quotes[1] = " Hello8";

quotes[2] = " Good to see you again8";

quotes[3] = " What a pleasure it is to see you8";

quotes[4] = " 7Having a good time, we hope.";

var whichquote=Math.floor(Math.random()*(quotes.length))

document.write(quotes[whichquote])
×

Success!

Help @shashankssss spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...