Creating Objects - Javascript Language Basics

Javascript examples for Language Basics:Introduction

Introduction

JavaScript supports the notion of objects.

Demo Code

ResultView the demo in separate window

<!DOCTYPE HTML>
<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        <script type="text/javascript">
            var myData = new Object();
            myData.name = "Joe";
            myData.topic = "raining";

            document.writeln("Hello " + myData.name + ". ");
            document.writeln("Today is " + myData.topic + ".");
        </script>
    </body>
</html>/*from  www . j ava 2  s  .c o  m*/

Related Tutorials