Knowledge Walls
Ammu
Hyderabad, Andhra Pradesh, India
Passcode:
Odd or even in Examples of Javascript 1
1052 Views
Examples
<!DOCTYPE html>
    <html lang="en-US">
        <head>
            <meta charset="UTF-8">
            <title>string</title>
        </head>
        <body>
            <script>
                var date1=new Date();
                console.log(date1);
                if(date1.getDate() % 2 == 0)
                    {
                      document.write("even");
                    }
                    else{
                        document.write("odd");
                    }
                
            </script>    
        </body>
    </html>
assigned date
<!DOCTYPE html>
    <html lang="en-US">
        <head>
            <meta charset="UTF-8">
            <title>string</title>
        </head>
        <body>
            <script>
                var date1=new Date(2019,12,11);
                if(date1.getDate() % 2 == 0)
                    {
                      document.write("even");
                    }
                    else{
                        document.write("odd");
                    }
                
            </script>    
        </body>
    </html>
Next Topics
Next lessons of current book.
Examples of Javascript 1
Examples of Javascript 1
Previous Topics
Previous lessons of current book.
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Best Lessons of "Javascript 1"
Top lessons which are viewed more times.
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details