Trouble with Quizlet level on Web Dev 2 - Campaign


#1

I have spent a lot of time on this level trying to figure out where I’m doing something wrong. I have all the objectives complete except the “Have 4 .answers with data-value D”. I checked it to the rest of my code, and even referenced it to the example given. I can’t seem to find the specific issue keeping me from succeeding. I’ve tested the quiz multiple times and narrowed it down to the data-value is not being counted on question 2, answer D.

    <div class="quizQuestion">
        <h2>2. Which smells the best?</h2>
        <div class="answers">
            <div data-value="A" class="answer">
                <div class="answerText">A: Snow</div>
            </div>
            <div data-value="B" class="answer">
                <div class="answerText">B: Farm</div>
            </div>
            <div data-value="C" class="answer">
                <div class="answerText">C: Burning Things</div>
            </div>
            <div dat-value="D" class="answer">
                <div class="answerText">
                    D: Grass
                </div>
            </div>
        </div>
    </div>
Off Topic

I wasn’t sure if I could or should put the rest of the code for this level since I might have it correct and from what I understand I’m not supposed to post correct code.

Hope I put that in the correct format on here, if not I’ll try to fix it as soon as possible. Just let me know I did so, so that I can.


#2

Riiiight there.

20 character Discourse limit.


#3

@serg yeah…not sure how I missed that. Thanks so much! It fixed everything and now on to the Desert!


#4

@Serg I don’t understand what the data-value means. I’m really young. My brother introduced me to this because he thought it would get me into coding


#5

The data-value attribute inside an HTML tag tells jQuery what information is stored inside the element.

Like <img> tags have the src attribute, you can assign whatever attribute you want… But most of the time they aren’t used by the browser. But, if you assign an attribute yourself, you can use it for any thing you want with a little bit of JavaScript. In this case, the data-value tells the script what answer letter the particular <div> is.

See how the data-value letter matches up with which answer it should be?


#6

@Serg Thanks so much! I get it! :joy: