我希望在单击按钮并且该项目已添加到购物篮后,它会自动转到页面的购物篮部分,但我不太知道如何在不弄乱其余 JavaScript 的情况下对此进行编码按钮的代码已经存在。
任何代码片段将不胜感激。
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<header class="main-header">
<nav class="main-nav nav">
</nav>
</header>
<div class="shop-items">
<div class="shop-item">
<span class="shop-item-title">Album 0</span>
<div class="shop-item-details">
<span class="shop-item-price">£12.50</span>
<button class="btn btn-primary shop-item-button" type="button">ADD TO BASKET</button>
</div>
<div class="shop-item">
<span class="shop-item-title">Album 2</span>
<div class="shop-item-details">
<span class="shop-item-price">£14.50</span>
<button class="btn btn-primary shop-item-button" type="button">ADD TO BASKET</button>
</div>
<div class="shop-item">
<span class="shop-item-title">Album 4</span>
<div class="shop-item-details">
<span class="shop-item-price">£19.50</span>
<button class="btn btn-primary shop-item-button" type="button">ADD TO BASKET</button>
</div>
</div>
</section>
<div class="shop-items">
<div class="shop-item">
<span class="shop-item-title">Album 6</span>
<div class="shop-item-details">
<span class="shop-item-price">£19.50</span>
<button class="btn btn-primary shop-item-button" type="button">ADD TO BASKET</button>
</div>
<div class="shop-items">
<div class="shop-item">
<span class="shop-item-title">Album 8</span>
<div class="shop-item-details">
<span class="shop-item-price">£19.50</span>
<button class="btn btn-primary shop-item-button" type="button">ADD TO BASKET</button>
</div>
炎炎设计
www说
相关分类