Please help! Code pen. Js + html/css

Aerial silk trick selector

I think i figured out how to make it look similar on the phone as the web but web responsiveness is still difficult for me.

Also!! :slight_smile: The answer (the js) I would love it to be centered and on top of the white div but it kind of only responds to the h1 element and I’ve tried wrapping in several different tags and classes. I have no idea what it is responding to.

and if you’re still reading lol Is there a better way to input a name other than a prompt box. I don’t even know what to google.

Hey there,

What do you mean by “responds to the h1”?

Your document.write result goes after the last stuff.

Moreover you can remove all HTML code excluding the h1 and the div, because codepen only wants you to add the stuff that lives in a body.

Then you can remove the document.write, instead add the result of the prompt into a new element (createElement) and add it into the div (appendChild)

1 Like

Thank you for replying!!!

I am trying it out now, it seems to give me a very similar result of not being on the white background. Why is this method better? How do i get the if statement : if username = “” … to cooperate with the new element.

Where is this stuff covered in FCC?

What i mean by responding to the h1 i mean the css rules :
h1{
}
applies to the text color etc but not placement. Is there a text book or something that you would recommend?

reading from https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement :flushed:

I marked your answer as the solution because I was able to make many changes by knowing what to look up. So Thank you!!!

Any ideas on how to make the button clickable more than once? :slight_smile: :blush:

Your solution to use innerHTML is also fine. FCC is not a full-blown compendium of every possible solution out there.

Great work, glad you made it!

What are your ideas?

Currently, when the user clicks, you run the writeName function. But the generation of the random number and the other stuff only runs once when you load the page.

1 Like

:slight_smile: :smile: My idea is to google and read until I find something that works!
I am thinking it might need to be a loop rather than a switch.