Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8525557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:00:56+00:00 2026-06-11T08:00:56+00:00

I am trying to print a yearly calendar on one page using JS. This

  • 0

I am trying to print a yearly calendar on one page using JS. This specifically seems to be the function giving me issues. Let me know if you could point me in the right direction, or if I can provide more info. Thanks

function yearly(calDate)    {
    if (calDate == null) calendarDay = new Date();
    else calendarDay = new Date(calDate)

    var currentTime = calendarDay.getTime();
    var thisYear = calendarDay.getFullYear();

    <table id='yearly_table'><tr>
        <th id='yearly_title' colspan='4'>
        thisYear;
    </th>
    </tr>
    var monthNum=-1;

    for (var i=1;i<=3;i++)  {
        document.write("<tr>");
    for (var j=1;j<=4;j++) {
        monthNum=monthNum++;
        calendarDay.setDate(1);
        calendarDay.setMonth(monthNum);
        writeMonthCell(calendarDay, currentTime);
    }
    <"</tr>">
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:00:57+00:00Added an answer on June 11, 2026 at 8:00 am

    You can’t put html into a javascript function like that. Javascript can only contain javascript statements, no html tags. The browser will try to execute your html as being javascript statements and won’t recognise any of it.

    You need to insert it into the DOM. Use methods like getElementById, createElement and appendChild. More info here

    For example, to write some text to an element you do this:

    // get the element using it's ID
    var element = document.getElementById("myElementId");
    
    // create a child element
    var newElement = document.createTextNode("This is my text");
    
    // write some text into it
    element.appendChild(newElement);
    

    You can see the example run here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to print out a list of products on a page. This is
i'm trying to print ascii or extended ascii character. using this code : print
I'm trying to print this page under the link graded fabric ArcCom in IE
Im trying print Excel file data on a page. To do it i used
I am trying to print HTML with this JavaScript in the webview, however it
I am trying to print a particular text using awk if string is empty.
Im trying to print, using a xslt sheet a url but im having problems
I'm trying to print out the body of a HTTP response using Python. Here
I am trying to print what my function returns with use of alert() but
I'm trying to print the list created by the functions in this class- what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.