Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Gregory Ledger
Gregory Ledger
6,116 Points

Getting value of if condition via a prompt

In this video, Hampton adds the value to the box mixin by hand. But how would you dynamically add the value based on a prompt or something happening in the dom through a script?

3 Answers

anil rahman
anil rahman
7,786 Points

you didn't link the video. But if you are talking about prompt windows then i would assume it's javascript you would need.

The javascript to create a prompt is :

prompt("enter your name...");

To save the prompt value into a variable to use however you would like is:

var z = prompt("enter your name...");
Gregory Ledger
Gregory Ledger
6,116 Points

Sorry the video is called Modular CSS with Sass

So this would be a Sass question

anil rahman
anil rahman
7,786 Points

ahh sorry sounded very much like a javascript kind of question :P my bad