1.Creating HTML Elements worded confusingly?


#1



https://www.codecademy.com/courses/web-beginner-en-v6phg/0/1?curriculum_id=50a3fad8c7a770b5fd0007a1


In script.js I put the following code because I thought it was what the instructions was asking for based on the wording:

In script.js, create a variable, $h1, and set it equal to a jQuery object CONTAINING an <h1> tag with the text "Hello". The tag should be a string.

The emphasis is mine. If they wanted me to instead target <h1>Hello</h1> ... that's just a little silly of a way to ask for it no?


var $h1 = $("h1:contains('Hello')");

I just don't get this instruction and think it should be reworded.


#2

@sirneptune

The instructions tell you to store in a variable named $h1 the h1 tag with the text Hello. Remember how to select an html element:

var $varName = $('<tagname>something in here<tagname>');

#3

So the instructions wanted me to create the HTML element, not find it. I guess I get used to finding clues from their instructions and went too far! Thanks!


#4

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.