Enter a name (optional) and click the button to generate a random silly story!
Your silly story will appear here!
Generate Story
<script>
const characters = ['a talking banana', 'a sleepy dragon', 'a dancing robot', 'a mischievous cat', 'a clumsy wizard'];
const actions = ['won a dance competition', 'ate 100 pancakes', 'invented a flying car', 'fell into a mud puddle', 'tried to juggle flamingos'];
const locations = ['on the moon', 'in a magical forest', 'at the bottom of the ocean', 'inside a volcano', 'at a spooky haunted house'];
function getRandomElement(arr) {
return arr[Math.floor(Math.random() * arr.length)];
}
function generateStory() {
const nameInput = document.getElementById("nameInput").value.trim();
const name = nameInput || "Ashiq";
const character = getRandomElement(characters);
const action = getRandomElement(actions);
const location = getRandomElement(locations);
document.getElementById("story").innerText = `${name} met ${character} who ${action} ${location}!`;
}
</script>