Build a Bookstore Page - Step 19

Tell us what’s happening:

Could someone please lead me in the right direction and explain to me what need to do to I am doing wrong ?

Your code so far

<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>XYZ Bookstore Page</title>
</head>

<body>
  <h1>XYZ Bookstore</h1>
  <p>Browse our collection of amazing books!</p>
  <div class="card-container">
    <div class="card" id="sally-adventure-book">
      <h2>Sally's SciFi Adventure</h2>
      <p>This is an epic story of Sally and her dog Rex as they navigate through other worlds.</p>
      <button class="btn">Buy Now</button>
    </div>
    <div class="card" id="dave-cooking-book">
      <h2>Dave's Cooking Adventure</h2>
      <p>This is the story of Dave as he learns to cook everything from pancakes to pasta, one recipe at a time.</p>
      <button class="btn">Buy Now</button>
    </div>
  </div>

<!-- User Editable Region -->

  <p>Review your selections and continue to checkout.</p>
  <div class="btn-container">
  <button class="btn"><view-cart-btn="btn">View cart</button>
  <button class="btn"><checkout-btn="btn">Checkout</button>
  </div>

<!-- User Editable Region -->

</body>

</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0

Challenge Information:

Build a Bookstore Page - Step 19

First button:
Id: view-cart-btn
Class: btn
Text: View Cart

Your button element should have an id attribute with the value "view-cart-btn"

This is not a valid element: <view-cart-btn="btn">

Hi @Kingchance ,

Welcome to the forum!

I see two issues in your code.

  1. Both buttons “View Cart” and “Check out” are missing “id” attribute.

removed
2. Second button text is “View cart”, Change the “cart” to upper case ‘C’. Because the tests methods are checking with case sensitive.

removed

All the best!

Thank you all for your advice, it was greatly appreciated.

1 Like

id is an attribute, just like class is an attribute in the div element above your buttons. The syntax to add an id attribute to the button element is the same as the syntax you used to add the class attribute to the div element.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

that wasnt a solution, but i apologize if the content contained spoilers.

That message was not directed to you.

You absolutely need to share your code if you need help. However, it’s better to copy/paste the code in a message here instead of a screenshot.

Hi @Kingchance ,

I see you corrected the first mistake but while adding ‘id’ attribute again there is syntax error. Please add the id attribute inside the button tag. Here is an example,

Mod Edit: SOLUTION REMOVED

Modify both buttons to follow the same pattern as above. Keep practicing so you will understand how the html elements are written with proper open and close tags.

Calling it an example doesn’t get around the rule for not posting solutions. Please stop doing that

1 Like

its still telling me to add an id attribute, im trying guys i really am.

In this line of code, can you say what the attributes are in this div element’s starting tag?

Its '‘class and id” right?

Yes. And that example also shows the syntax used for adding attributes inside an element’s starting tag. So, knowing that, all you need to do is add an id attribute inside the button element’s starting tag with the value given in the instructions.

Note - it is easier if you post the code itself instead of a picture of the code

Thank you so much i passed!!!

1 Like