JavaScript – Beginner Tutorial 02 [Print “Hello SyfiMe”]

Javascript Tutorials - Print Somethng

Hello guys, welcome to syfime and make sure you check this tutorial after checking the previous one. This is the 2nd tutroial of this series. Today, I’m going to teach you how to print something on your web page using java script. As I said in prvious lesson, you should know some basics of HTML. If you know HTML, you can follow these tutorials. OK. Take a deep breath and get ready.

  • Open your editor (Maybe notepad++/brackets)
  • Type this HTML code in your editor


<!DOCTYPE html5>
<title>Syfime Tut 2 (Print Something)</title>


  • Now Save your file as index.html in your created folder or someplace. And now, you have created your HTML document. Check it before go to the next step. You can not see anything in content area. However, the title is showing as your given title. After it’s clear, we have add JavaScript code lines to our body.
  • Type this code before the </body> tag.


<script type="text/javascript">
 document.write("Hello, SyfiMe"); 

  • Now make sure JavaScript is working on your browser. For that, you can refresh or open again your HTML document and make your this message is showing i your content area. If it’s not showing or get any error messages, check your code again.


There are some older browsers, they have designed to underhand only basic HTML web pages. But as i know, they all have updated. Because of that, It won’t be matter to you. Additionally, I will teach you how to check JavaScript is working in older browsers.

To check it you can add these lines to your code and old browser will get it as a comment and nothing will be displayed on the page. But latest browser will understand, it’s a JavaScript code and it will show your message.


<script type="text/javascript">
document.write("Hello, SyfiMe"); 


However, now you have an idea about how print something on your web page and how to check whether browser supports JS or not.  That’s all that i need to teach you guys for this post. You can test this within 2-4 minutes. However, try to understand future lessons very clearly, because they are teaching you fundamentals of programming. Thank you again. Stay with us.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: