Skip to main content

How to make dropdown menu button also a button for a link?

This is my html code and I cant figure out how to get the button to be a link. Despite adding the anchor tag with a link inside, when I click on the button, nothing happens.

<!DOCTYPE html>

<html lang="en">
    <head>
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
        <link href="styles.css" rel="stylesheet">
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Week 8 Homepage</title>
        <script src="homepage.js"></script>
    </head>
    <body>
        <div class="top flex">
          <span><a href="index.html" style="text-decoration: none"><h1 class="icon">Ron's Clothes</h1></a></span>

          <span>
            <div class="dropdown link1">
              <a href="link1.html" style="text-decoration: none;">
                <button class="btn btn-secondary btn-clr dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                  Shop
                </button>
              </a>
              <ul class="dropdown-menu">
                <li><a class="dropdown-item" href="link1.html">Tops</a></li>
                <li><a class="dropdown-item" href="link1.html">Pants</a></li>
                <li><a class="dropdown-item" href="link1.html">Outerwear</a></li>
              </ul>
              <a href="link1.html" style="text-decoration: none;"></a>
            </div>
          </span>

        </div>

        <img class="image" src="Screenshot (27).png" alt="clothes image">

        <h1 class="featured">Featured Items</h1>

        <div class="featuredimg">
            <div class="column position1">
              <a href="link1.html" style="text-decoration: none;">
                <img src="shirt1.jpeg" alt="featured1" style="width: 75%">
                <p>Early 90s Brine for Major Soccer<br>League Tee<br><strong>$38.58</strong></p>
              </a>
            </div>
            <div class="column position2">
              <img src="shirt2.jpeg" alt="featured2" style="width: 75%">
              <p>90s Nike 'There Is No Finish Line'<br>Windbreaker<br><strong>$75.32</strong></p>
            </div>
            <div class="column position3">
              <img src="shirt3.jpeg" alt="featured3" style="width: 75%">
              <p>1992/1993 Manchester United F.C.<br>Training Tee<br><strong>$68.64</strong></p>
            </div>
            <div class="column position4">
              <img src="shirt4.jpeg" alt="featured4" style="width: 75%">
              <p>1995 Houston Rockets x Looney Tunes<br>'Daffy Duck' Tee<br><strong>$43.93</strong></p>
            </div>
          </div>
    </body>
</html>

I tried shifting the anchor tag around and it doesn't work, sometimes the dropdown menu stops working too. I tried using javascript, giving the button and id and adding event listener but that doesn't work either. I need some help on this as I'm out of ideas.

Via Active questions tagged javascript - Stack Overflow https://ift.tt/74UcPJO

Comments

Popular posts from this blog

How to show number of registered users in Laravel based on usertype?

i'm trying to display data from the database in the admin dashboard i used this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count(); echo $users; ?> and i have successfully get the correct data from the database but what if i want to display a specific data for example in this user table there is "usertype" that specify if the user is normal user or admin i want to user the same code above but to display a specific usertype i tried this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count()->WHERE usertype =admin; echo $users; ?> but it didn't work, what am i doing wrong? source https://stackoverflow.com/questions/68199726/how-to-show-number-of-registered-users-in-laravel-based-on-usertype

Why is my reports service not connecting?

I am trying to pull some data from a Postgres database using Node.js and node-postures but I can't figure out why my service isn't connecting. my routes/index.js file: const express = require('express'); const router = express.Router(); const ordersCountController = require('../controllers/ordersCountController'); const ordersController = require('../controllers/ordersController'); const weeklyReportsController = require('../controllers/weeklyReportsController'); router.get('/orders_count', ordersCountController); router.get('/orders', ordersController); router.get('/weekly_reports', weeklyReportsController); module.exports = router; My controllers/weeklyReportsController.js file: const weeklyReportsService = require('../services/weeklyReportsService'); const weeklyReportsController = async (req, res) => { try { const data = await weeklyReportsService; res.json({data}) console...

ValueError: X has 10 features, but LinearRegression is expecting 1 features as input

So, I am trying to predict the model but its throwing error like it has 10 features but it expacts only 1. So I am confused can anyone help me with it? more importantly its not working for me when my friend runs it. It works perfectly fine dose anyone know the reason about it? cv = KFold(n_splits = 10) all_loss = [] for i in range(9): # 1st for loop over polynomial orders poly_order = i X_train = make_polynomial(x, poly_order) loss_at_order = [] # initiate a set to collect loss for CV for train_index, test_index in cv.split(X_train): print('TRAIN:', train_index, 'TEST:', test_index) X_train_cv, X_test_cv = X_train[train_index], X_test[test_index] t_train_cv, t_test_cv = t[train_index], t[test_index] reg.fit(X_train_cv, t_train_cv) loss_at_order.append(np.mean((t_test_cv - reg.predict(X_test_cv))**2)) # collect loss at fold all_loss.append(np.mean(loss_at_order)) # collect loss at order plt.plot(np.log(al...