Random Quote Generater By Your Name code free
index.html
1
<html>2
<head>3
<title>Random Quote Generator</title>4
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">5
</head>6
<body>7
<div class="container mt-5">8
<h1 class="text-center mb-4">Random Quote Generator</h1>9
<div class="input-group mb-3">10
<input type="text" id="nameInput" class="form-control" placeholder="Enter your name">11
<button class="btn btn-primary" onclick="generateQuote()">Generate Quote</button>12
</div>13
<div id="quoteOutput" class="mt-3"></div>14
</div>15
16
<script>17
function generateQuote() {18
const name = document.getElementById('nameInput').value;19
const quotes = [20
`"${name}, the only way to do great work is to love what you do."`,21
`"${name}, life is 10% what happens to us and 90% how we react to it."`,22
`"${name}, success is not the key to happiness. Happiness is the key to success."`,23
`"${name}, the only limit to our realization of tomorrow will be our doubts of today."`,24
`"${name}, believe you can and you're halfway there."`25
];26
const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];27
document.getElementById('quoteOutput').innerHTML = `<p class="lead">${randomQuote}</p>`;28
}29
</script>30
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js"></script>31
</body>32
</html>styles.css
1
/* Replace with your CSS Code 2
(Leave empty if not needed) */ 3
main.js
1
/* Replace with your JS Code 2
(Leave empty if not needed) */3
