How to change image randomly in a webpage using JavaScript ?

In this tutorial, we are going to learn to change image randomly in a webpage using JavaScript. We will defined fixed set of images which will be used in the webpage randomly after certain interval. Watch this video for complete... Read more

Random Background Color using JavaScript

In this post, we will be writing a simple JavaScript function that will generate random color which we set as the background of webpage. Source Code : <body onclick="changeColor();"> </body> <script type="text/javascript"> function generateColor(){ length = 6; var chars =... Read more

Random Quotes Generator using PHP API

The following source code demonstrates a simple PHP API to get random quote. We simply need to make a GET request to the API endpoint : https://api.quotable.io/random and we will get a random quote in response. Full Source Code :... Read more

Generate Random String using JavaScript

In this post, we will be writing a simple JavaScript function that will generate random string of desired length. We can generate a random string with fixed set of characters using simple match and string functions. <script> function generateRandomString(length){ var... Read more

Generate Random String using PHP

In this post, we will be writing a simple PHP function that will generate random string of desired length. We can generate a random string with fixed set of characters using simple string functions like substr, str_shuffle and str_repeat. <h1>Generate... Read more