Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>TaRic Kabaliwan - Q and A</title>
- <link rel="stylesheet" href="./bootstrap/dist/css/bootstrap.css">
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
- <style>
- .jumbotron {
- text-align: center;
- }
- .qanda {
- text-align: center;
- margin-bottom: 16px;
- }
- .question {
- margin-bottom: 24px;
- font-size: 30px;
- display: none;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="jumbotron display-4">TaRic Kabaliwan - Q and A</div>
- <div class="qanda">
- <!-- content here -->
- <div class="question">Sample question here</div>
- <div class="btn btn-primary">Click Here</div>
- </div>
- </div>
- <script>
- $(function() {
- const question = [
- "Sino mabilis magselos?",
- "Sino mabilis bumaho ang kili kili?",
- "Sino yung kahit nagttoothbrush na mabaho pa din ang hininga?",
- "Sino yung mabilis magalit?",
- "Sino mas mabait?"
- ];
- function questionRandom(arr) {
- const number = Math.floor(Math.random() * arr.length);
- return arr[number];
- };
- $('.btn').on('click', () => {
- $('.question').show().text(questionRandom(question));
- })
- var numbers = [1, 2, 3, 4];
- function shuffle(o) {
- for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
- return o;
- };
- var random = shuffle(numbers);
- console.log(random);
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement