Need help: Introduction and JavaScript Alert Demonstration

Hi!
I am a complete beginner to programming and started the JavaScript for Blockchain course without a proper introduction in HTML. Which is why I am completely stuck on the Introduction and JavaScript Alert Demonstration exercises. I am wondering if I can get some guidance from anyone at Ivan on Tech Academy, as I desperately need to get unstuck from this initial hump. I am also wondering if it may not be the case I have to study HTML before going full on into JavaScript.
Looking forward to your support and feedback!
Regards,
S

Hello @sergio.lugo77, hope you are ok.

Our JavaScript Course offer at the beginning a whole category dedicated to HTML fundamentals.

Now if you are facing a code issue, we would love to help you, the usual to reach our team is to ask for help in the proper topic (JavaScript in this case, I need help with JavaScript).

I can check your code if you want, so we can verify what is the issue on it. :nerd_face:

You can use the “Preformatted Text” Button to encapsulate any kind of code you want to show.


function formatText(){

let words = “I’m a preformatted Text box, Please use me wisely!”

}

prefromatted_text-animated

Carlos Z.

Hi Carlos Z.,
Well, the problem might be that I’m not following the exact example on Ivan’s tutorial. Given my complete unfamiliarity with HTML I went ahead and followed a short tutorial to create some web content: https://www.wikihow.com/Create-a-Simple-Web-Page-with-HTML

I then used some of my written work to create text headings and paragraphs along with an image and a link, here’s the code for it if you have time to take a look:

<!DOCTYPE html>
<html>
<head>
<title>Claudia</title>
</head>
<body style="background-color:darkred;">
<h1>Claudia</h1>
<img src="https://media.gettyimages.com/photos/-picture-id10105118?s=170667a"
<br>
<h2>A teenage story about paranormal revange</h2>
<h3>Written by Sergio Lugo</h3>
<h4>SINOPSIS:</h4> 
<p>Diagnosed at birth with a strange form of high functioning autism, Claudia is a shy and withdrawn, super intelligent teenager on a journey of self empowerment after being drugged on her 13th birthday. Through a series of existential breakthroughs, she is able to tap into her inner power source, unleashing the telepathic abilities she was born with in order to brilliantly orchestrate the perfect revenge, six years later.</p>

<br>
<a href="https://www.foxnews.com/">Foxnews</a>
<br>
</body>
</html>

The problem starts when I open the console and try to insert the JavaScript command to create the pop-up alert, as the code format in the Console doesn’t seem to allow it.

I’m thinking maybe I should try to establish the JavaScript code right from the notebook file where I created the HTML file.

Thoughts?

Oh yeah! I forgot to mention I am using the Microsoft Edge browser, which seems pretty new in my experience, I am wondering if this might also be causing issues with the code format in the Console.
Thank you in advance for any feedback you may be able to provide for this.
Regards,
S

Hello @sergio.lugo77, hope your great.

You should follow Ivan instructions on the course, in the alert lesson you should create your own JavaScript script on your html file, not in The console.

The console you can use it to implement code that is not going to be saved on your main file. But is not always the best way when you are learning.

I advice you to check Ivan’s html videos of the course and follow his guidelines properly.

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

Thank you @thecil,
Could you please provide a link to the HTML courses? I can’t find anything along those lines on the course catalogue,
thanks!
S

Sure.

From that point is the HTML category on the JavaScript Course.

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like

OK! I am now unstuck :slight_smile:

I’ve gone through some HTML basics and created some fairly decent web content from a .txt document, I’ve saved it as .html and added text and images. After that I was able to create the popup alert for it using the console. I’ve applied some of the functions mentioned in the Console Reading Assignment using console.log, and have been able to write background color as well as font color changes into my .html document using…

document.body.style.backgroundColor = “lightblue”;

This method can include changes in text color using:

document.body.style.color = “white”;

I’ve tried creating paragraph elements as described in the reading using the following inserts:

let p = document.createElement(“P”);

let t = document.createTextNode(“Paragraph text.”);

p.appendChild(t);

However, it seems these changes are not visible on the .html document, I am therefore wondering if there are any good resources further elaborating on how these are used and what sort of content changes they make possible.

I sincerely appreciate any info you can send my way on this.

1 Like

Ok, here are some resource links that can be useful, still I could help you review your code to check that everything is OK.

You can use the “Preformatted Text” Button to encapsulate any kind of code you want to show.


function formatText(){

let words = “I’m a preformatted Text box, Please use me wisely!”

}

prefromatted_text-animated

Carlos Z.