JavaScript Tutorial-21


  1. <html>
  2. <head>
  3. <title>JavaScript</title>
  4. </head>
  5. <body>
  6. <p> Today </p>
  7. <SCRIPT LANGUAGE=”JavaScript”>
  8. var today=new Date();
  9. write(“Today”);
  10. var todaysNum = today.getDay();
  11. var todaysName = dayName(todaysNum);
  12. write(todaysName);
  13. function dayName(day)
  14. {
  15. var names= new Array(7);
  16. names[0]= “Sunday”;
  17. names[1]= “Monday”;
  18. names[2]= “Tuesday”;
  19. names[3]= “Wednesday”;
  20. names[4]= “Thursday”;
  21. names[5]= “Friday”;
  22. names[6]= “Saturday”;
  23. return names[day];
  24. }
  25. </Script>
  26. </body>
  27. </html>

Explain of Script:

  • Line number 1 is a start is a html tag.
  • Line number 2 is a start is a head tag.
  • Line number 3 is a title tag. This page title is “JavaScript”.
  • Line number 4 is a close head tag.
  • Line number 5 start body tag.
  • Line number 6 write message “Today”
  • Line number 7 start JavaScript tag.
  • Line number 8 call new data.
  • Line number 9 write “Today” Message
  • Line number 10 is today.getDay(); function Call.
  • Line number 11 is var todaysName = dayName(todaysNum).
  • Line number 12 is write todaysName.
  • Line number 13 is getName(day)
  • Line number 14 uses “{”
  • Line number 15 is 7 array declare
  • Line number 16 is declare array [0]= “Sunday”.
  • Line number 17 is declare array [1]= ” Monday “.
  • Line number 18 is declare array [2]= ” Tuesday “.
  • Line number 19 is declare array [3]= ” Wednesday “.
  • Line number 20 is declare array [4]= ” Thursday “.
  • Line number 21 is declare array [5]= ” Friday “.
  • Line number 22 is declare array [6]= ” Saturday “.
  • Line number 23 is return function names[day].
  • Line number 24 is End “}”
  • Line number 25 is a closed JavaScript tag.
  • Line number 26 is a close body tag.
  • Line number 27 is a close html tag.

11 thoughts on “JavaScript Tutorial-21

  1. Thanks so much for giving everyone an extremely special opportunity to read critical reviews from this site. It’s always very amazing plus packed with a lot of fun for me personally and my office friends to search your site on the least 3 times every week to read the fresh items you have got. Not to mention, I am also usually impressed considering the good secrets served by you. Selected 4 facts in this posting are basically the most suitable we have all had.

  2. My husband and i were very happy when Raymond managed to complete his reports with the ideas he discovered through your site. It is now and again perplexing to simply choose to be offering strategies that some people have been trying to sell. And we all take into account we have the blog owner to give thanks to for this. All of the explanations you’ve made, the straightforward website menu, the relationships your site make it possible to foster – it’s got everything great, and it’s facilitating our son and the family recognize that this situation is entertaining, and that’s quite mandatory. Many thanks for the whole thing!

  3. I have to express some thanks to this writer just for rescuing me from this scenario. Because of exploring through the the net and seeing tricks that were not productive, I thought my entire life was gone. Living without the presence of strategies to the difficulties you’ve fixed by means of your good write-up is a serious case, and ones which could have badly damaged my entire career if I hadn’t noticed your blog. That capability and kindness in controlling all the pieces was very useful. I don’t know what I would have done if I hadn’t discovered such a solution like this. I can at this moment relish my future. Thanks for your time so much for this skilled and results-oriented guide. I will not be reluctant to propose your web site to any person who wants and needs tips about this subject matter.

  4. I actually wanted to develop a small word in order to say thanks to you for all the great ways you are sharing at this site. My prolonged internet lookup has now been honored with useful knowledge to share with my friends. I would assert that many of us visitors actually are rather blessed to dwell in a fantastic place with so many marvellous people with insightful pointers. I feel rather fortunate to have discovered your web pages and look forward to plenty of more pleasurable times reading here. Thanks once again for everything.

  5. I am just commenting to make you know of the wonderful experience my wife’s princess experienced using your web site. She learned so many pieces, with the inclusion of what it is like to have a marvelous giving heart to get the others without hassle know precisely selected tricky matters. You actually surpassed her desires. I appreciate you for showing those good, trusted, informative and unique tips about your topic to Tanya.

  6. Thanks for all your valuable labor on this website. Kate delights in getting into investigations and it’s really easy to see why. All of us learn all about the lively mode you create very important strategies on your website and therefore attract participation from others on that concept while our own child is without question being taught so much. Take pleasure in the rest of the year. You are always performing a glorious job.

  7. I intended to post you one tiny observation just to say thanks yet again about the fantastic techniques you have contributed in this case. It is so seriously open-handed of people like you to allow openly all some people could possibly have offered as an ebook to help make some dough on their own, most importantly seeing that you could possibly have done it in the event you wanted. The principles additionally acted to become a fantastic way to be certain that someone else have the same zeal just like my very own to grasp great deal more concerning this condition. I’m sure there are thousands of more pleasant opportunities in the future for individuals who looked at your blog post.

  8. I simply wanted to send a quick message in order to appreciate you for all of the amazing tips you are giving out on this website. My time intensive internet investigation has at the end of the day been compensated with high-quality tips to exchange with my friends and family. I ‘d tell you that many of us site visitors are rather fortunate to dwell in a superb site with so many perfect professionals with helpful solutions. I feel very privileged to have used the webpage and look forward to some more amazing times reading here. Thank you once again for a lot of things.

  9. I simply wanted to thank you so much yet again. I’m not certain the things I could possibly have followed in the absence of the thoughts discussed by you over such problem. It had been a real challenging crisis in my opinion, but being able to see this well-written fashion you treated it forced me to weep with gladness. I’m just happier for the guidance and believe you realize what an amazing job that you are doing teaching people today all through your web blog. I am certain you haven’t got to know all of us.

  10. I wish to express my passion for your generosity for those individuals that actually need help on this important concern. Your personal dedication to passing the solution along had become extraordinarily invaluable and has regularly permitted folks like me to get to their objectives. Your new important information means this much a person like me and somewhat more to my office workers. Warm regards; from all of us.

  11. I wanted to develop a simple word in order to appreciate you for some of the magnificent steps you are placing on this site. My incredibly long internet investigation has at the end of the day been compensated with reputable details to talk about with my family and friends. I ‘d assume that we website visitors actually are rather lucky to be in a really good site with very many perfect professionals with useful methods. I feel somewhat privileged to have come across your entire web page and look forward to plenty of more fun moments reading here. Thanks once again for a lot of things.

Leave a Reply

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