pctechguide.com

  • Home
  • Guides
  • Tutorials
  • Articles
  • Reviews
  • Glossary
  • Contact

JavaScript Code that Shares Astrology Predictions on Website

Astrology may not be a topic that you expected to be covered on a PC technology website. However, we wanted to create a JavaScript program for people that are interested in it. Many people are into astrology these days so this can be a great idea for a website for people that enjoy astrology. You can of course modify the JavaScript code to have different predictions that the default ones listed below.

JavaScript Program that Shares Daily Astrology Predictions

When you are using this program, you will simply need to choose your astrology sign from a dropdown menu. Here is the code to use it.

<body>
    <h1>Daily Astrology Predictions</h1>
    <label for="sign">Choose your astrology sign:</label>
    <select id="sign">
        <option value="aries">Aries</option>
        <option value="taurus">Taurus</option>
        <option value="gemini">Gemini</option>
        <option value="cancer">Cancer</option>
        <option value="leo">Leo</option>
        <option value="virgo">Virgo</option>
        <option value="libra">Libra</option>
        <option value="scorpio">Scorpio</option>
        <option value="sagittarius">Sagittarius</option>
        <option value="capricorn">Capricorn</option>
        <option value="aquarius">Aquarius</option>
        <option value="pisces">Pisces</option>
    </select>
    <button onclick="getPrediction()">Get Prediction</button>
    <div id="prediction"></div>

<script>
    function getPrediction() {
        const sign = document.getElementById("sign").value;
        let prediction = "";

        switch (sign) {
            case "aries":
                prediction = "Today, your assertive nature will shine in your career endeavors...";
                break;
            case "taurus":
                prediction = "Today, Taurus, your steadfast determination and practical approach will lead to significant progress in your professional endeavors...";
                break;
            case "gemini":
                prediction = "Today, Gemini, your adaptability and quick thinking will set you apart in the workplace...";
                break;
            case "cancer":
                prediction = "Today, Cancer, emotional intelligence plays a crucial role in your career...";
                break;
            case "leo":
                prediction = "Today, Leo, your natural charisma and confidence will be your greatest assets in the workplace...";
                break;
            case "virgo":
                prediction = "Today, Virgo, today requires attention to detail and meticulous planning in your professional endeavors...";
                break;
            case "libra":
                prediction = "Today, Libra, collaboration and diplomacy are key to your success in the workplace...";
                break;
            case "scorpio":
                prediction = "Today, Scorpio, strategic thinking and resourcefulness are essential in your career endeavors...";
                break;
            case "sagittarius":
                prediction = "Today, Sagittarius, your optimism and enthusiasm will inspire others to follow your lead...";
                break;
            case "capricorn":
                prediction = "Today, Capricorn, discipline and perseverance are required in your career pursuits...";
                break;
            case "aquarius":
                prediction = "Today, Aquarius, embrace innovation and originality in your career path...";
                break;
            case "pisces":
                prediction = "Today, Pisces, trust your instincts and follow your heart when making professional decisions...";
                break;
            default:
                prediction = "Please select an astrology sign.";
        }

        document.getElementById("prediction").innerText = prediction;
    }
</script>
</body>



Here is a modified version of the script if you would like to show the prediction in a paragraph under the dropdown box:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Daily Astrology Predictions</title>
</head>
<body>
    <h1>Daily Astrology Predictions</h1>
    <label for="sign">Choose your astrology sign:</label>
    <select id="sign">
        <option value="aries">Aries</option>
        <option value="taurus">Taurus</option>
        <option value="gemini">Gemini</option>
        <option value="cancer">Cancer</option>
        <option value="leo">Leo</option>
        <option value="virgo">Virgo</option>
        <option value="libra">Libra</option>
        <option value="scorpio">Scorpio</option>
        <option value="sagittarius">Sagittarius</option>
        <option value="capricorn">Capricorn</option>
        <option value="aquarius">Aquarius</option>
        <option value="pisces">Pisces</option>
    </select>
    <button onclick="getPrediction()">Get Prediction</button>
    <p id="prediction"></p>

<script>
    function getPrediction() {
        const sign = document.getElementById("sign").value;
        let prediction = "";

        switch (sign) {
            case "aries":
                prediction = "Today, your assertive nature will shine in your career endeavors...";
                break;
            case "taurus":
                prediction = "Today, Taurus, your steadfast determination and practical approach will lead to significant progress in your professional endeavors...";
                break;
            case "gemini":
                prediction = "Today, Gemini, your adaptability and quick thinking will set you apart in the workplace...";
                break;
            case "cancer":
                prediction = "Today, Cancer, emotional intelligence plays a crucial role in your career...";
                break;
            case "leo":
                prediction = "Today, Leo, your natural charisma and confidence will be your greatest assets in the workplace...";
                break;
            case "virgo":
                prediction = "Today, Virgo, today requires attention to detail and meticulous planning in your professional endeavors...";
                break;
            case "libra":
                prediction = "Today, Libra, collaboration and diplomacy are key to your success in the workplace...";
                break;
            case "scorpio":
                prediction = "Today, Scorpio, strategic thinking and resourcefulness are essential in your career endeavors...";
                break;
            case "sagittarius":
                prediction = "Today, Sagittarius, your optimism and enthusiasm will inspire others to follow your lead...";
                break;
            case "capricorn":
                prediction = "Today, Capricorn, discipline and perseverance are required in your career pursuits...";
                break;
            case "aquarius":
                prediction = "Today, Aquarius, embrace innovation and originality in your career path...";
                break;
            case "pisces":
                prediction = "Today, Pisces, trust your instincts and follow your heart when making professional decisions...";
                break;
            default:
                prediction = "Please select an astrology sign.";
        }

        document.getElementById("prediction").innerText = prediction;
    }
</script>

We hope that you enjoy this script! It can be great if you have a website that shares psychic or astrological predictions.

Filed Under: Articles

Latest Articles

3 Huge Benefits of White Label Mobile Wallets

For most, the term “Mobile Wallet” brings up images of consumer products such as Apple Pay, Paypal, or Square. Mobile wallets are revolutionizing the financial sector and continually growing in popularity - especially amongst Millenials - for their convenience and security.  A mobile … [Read More...]

AMD K6

For many years Advanced Micro Devices (AMD), like Cyrix, had made 286, 386 and 486 CPUs that were directly derived from Intel's designs. The K5 was the company's first independently created x86 processor, and one for which AMD had held high … [Read More...]

Phishing Attacks: Don’t take the bait!

Spotting a phishing email isn't as easy as one may think these days, and if you’ve ever clicked a link in one of those misleading emails, you’re not alone. In 2019, 94% of malware was delivered via email and 32% of breaches involved phishing. With phishing attacks more common than ever, many SMEs … [Read More...]

Gaming Laptop Security Guide: Protecting Your High-End Hardware Investment in 2025

Since Jacob took over PC Tech Guide, we’ve looked at how tech intersects with personal well-being and digital safety. Gaming laptops are now … [Read More...]

20 Cool Creative Commons Photographs About the Future of AI

AI technology is starting to have a huge impact on our lives. The market value for AI is estimated to have been worth $279.22 billion in 2024 and it … [Read More...]

13 Impressive Stats on the Future of AI

AI technology is starting to become much more important in our everyday lives. Many businesses are using it as well. While he has created a lot of … [Read More...]

Graphic Designers on Reddit Share their Views of AI

There are clearly a lot of positive things about AI. However, it is not a good thing for everyone. One of the things that many people are worried … [Read More...]

Redditors Talk About the Impact of AI on Freelance Writers

AI technology has had a huge impact on our lives. A 2023 survey by Pew Research found that 56% of people use AI at least once a day or once a week. … [Read More...]

11 Most Popular Books on Perl Programming

Perl is not the most popular programming language. It has only one million users, compared to 12 million that use Python. However, it has a lot of … [Read More...]

Guides

  • Computer Communications
  • Mobile Computing
  • PC Components
  • PC Data Storage
  • PC Input-Output
  • PC Multimedia
  • Processors (CPUs)

Recent Posts

Spain Technology Boom Boosts Computing Job Growth by 30%

We have carefully monitored the job market for IT and computer professionals in various countries. A recent study by InfoJobs shows that the market … [Read More...]

When the Future Takes Flight: Technology’s Impact On Post-COVID-19 Travel

In 2020, international and local travel screeched to an abrupt halt in light of mandatory quarantine precautions and unanswered questions related to … [Read More...]

Google Apps For Business is Making Strides

Google has evolved over the years. It was once only a search engine, and a darn good one. But, the company behind the search engine has evolved into a … [Read More...]

[footer_backtotop]

Copyright © 2025 About | Privacy | Contact Information | Wrtie For Us | Disclaimer | Copyright License | Authors