dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Write Date parts into pane does not work

  1. #1
    Join Date
    Oct 2013
    Posts
    10

    Write Date parts into pane does not work

    When I apply the following code to a webpage then it works:

    var div = document.getElementsByClassName("elemettag")[0];
    div.innerHTML = div.innerHTML + "sample text";

    when I apply the following, similar code it does NOT work:

    var d = new Date();
    var div = document.getElementsByClassName("elemettag")[0];
    div.innerHTML = div.innerHTML + "DATE=" + getDate(d) + "." + getMonth(d) + "." + getFullYear(d);

    Why?

    Peter

  2. #2
    Join Date
    Dec 2012
    Posts
    1,586
    E. g. look here:
    https://developer.mozilla.org/en-US/.../Date/getMonth
    This is correct:
    Code:
    d.getDate()

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center