I need help with open ended and solution

so pretty much i need to make a open ended question with only 1 correct answer! i need javascript from research but im full html and css.

1 Like

Very good, well-done, good luck.

my base text is pretty much input ,type=“text”. as the base but i dont know how to make it as if you put lets say ab then if u dont put in ab it dosent turn on say for (pts=ᵉ) i need that

Post your code here.

(html)(body)(input type=“text”)(/body)(/html)
this is my current code bc it aint let me put the right brackets in the message

explain the above line of your post. i did not get that.

I’m not at the level of skill to help you, but I thought I would make sure we understand what you’re needing so others can assist you.

You are asking for help in building a program that will take in any text value the user types in and check if it is correct or not, right? For example, a question like “What is the capital of France?” with an <input type="text"> element beneath it for the user to type in their answer. Unless the user inputs “Paris”, the program will show that the answer is incorrect. If the user inputs “Paris”, it will show that the answer is correct. Is this something like what you’re asking for?

Here on the forum, asking for others to basically build programs for you isn’t allowed, I think, but we’re more than happy to assist you with existing code. Try to learn and build the program by yourself, and if you hit any roadblocks, we’re here to help you through them. We just can’t write programs for you.

BTW, this program is not possible to build with only HTML and CSS. You will need Javascript too. If you think this is too challenging of a project for you at your current level of knowledge, save the idea for later when you know more Javascript and programming logic.

Happy coding,

Nicolas

3 Likes

thanks! ill be back when i learn how to do javascript.

and i also need info on how to put javascript in html…

to notice: if i press Shift + Ctrl + C on opera thats how i pretty much code (on About:blank)

1 Like

the line above the post ment i put (input type=“text”) then i need to atach something like a button that if i press it can say right or wrong

Learn from freecodecamp curriculum. Here’s the link of JavaScript learning throw challenge steps:

1 Like

This is relatively straightforward. There are a few ways to do it.

If you want to code your JS straight in your .html file, you can do that in between special <script>tags designed for that purpose.

<script>
  (put your JS here)
</script>

You’re probably wondering where to place these script tags. If you’re coding raw JS into your HTML file as shown above, it’s best to put them right before the closing tag of your <body>, but still being below all of the <body>'s content. In other words, the <script>element should be the last element nested in your <body> element. Here’s a screenshot to demonstrate.

However, as you get more and more advanced in JS, you will soon notice that the sheer size of your Javascript is making the length of your .html file ridiculous. It’s not convenient to use the method above for webpages requiring a lot of JS. In this case, we would place our JS in an external file and just reference to it in our HTML in a clean, simple, single line of mark-up.

<script src="myScript.js"></script>

“myScript.js” being, of course, your JS file name and path. You can name it whatever you like - as long as it ends with “.js”.

Where do we put this one in our HTML? You can place an external script reference in <head> or <body> as you like. I’ve noticed that on professional websites it’s often placed in the <head>, after all the meta and link (stylesheet) elements. And yes, you can have multiple external script references. Just stack them up next to each other.

You can read this for a better explanation. It covers how to get started with JS in html as well as some basic JS concepts.

Not sure about this method. I’ve never tried it. If you’re having difficulties with it, another good environment for beginners is a code playground like JSFiddle or CodePen. They have three separate places to type your HTML, CSS and Javascript, and they’re already linked together automatically, so you don’t need to worry about external file referencing. You just log in and start coding.

They’re good for practice. For real work on a professional level, VScode is a good application for that, as well as many others.

Sorry about the length and I hope I didn’t confuse you.

Happy coding!

Nicolas

1 Like

thank you! ill get right to work…

1 Like

Thank you too hasanzaib1389!

1 Like

I’ve made a website for submission https://thankssubmission.w3spaces.com and @nickrg I cant find a way to test if its right or wrong.

1 Like

(post deleted by author)

Below is the code for the website you built above.

<!doctype html>

<html>
    <head>
        <meta charset="utf-8">

        <title>Submited</title>

    </head>

    <body>

        <h1 style="font-family:verdana">Thank you for submitting.</h1>
        <p style="font-family:verdana">this a art project so no working submit and grade<p>
    </body>

</html>

Good work, no mistakes. It could be formatted a bit better, though. Like this:

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Submited</title>
    </head>

    <body>
        <h1 style="font-family:verdana">Thank you for submitting.</h1>
        <p style="font-family:verdana">this a art project so no working submit and grade<p>
    </body>
</html>

Is this the page to be displayed when the user has entered their answer? Is that your intention? If so, I don’t think it’s necessary to create a separate page for that. You can program it to check for the right/wrong answer all on one page - the same page the question is on. It just needs HTML, CSS and JS.

Why don’t you create the question page? You could put the question text, a text input for the user to enter their answer and a button for the user to check their answer. Then you could use CSS to style it nicely, with color and good positioning. Then you could implement the JS to make it functional.

This project should teach you most of the html and css necessary for the job. As for JS, well, that might take longer to learn. I don’t know if I could code it myself in JS yet - I’m just in beginner in Javascript.

Happy coding,

Nicolas

1 Like