Read and Modify the Property Values - Javascript Language Basics

Javascript examples for Language Basics:Introduction

Description

Read and Modify the Property Values

Demo Code

ResultView the demo in separate window

<!DOCTYPE HTML>
<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        <script type="text/javascript">
            var myData = {//from www  .j a  va  2 s  .co  m
                name: "java2s.com",
                topic: "CSS",
            };

            myData.name = "Joe";
            myData["topic"] = "raining";

            document.writeln("Hello " + myData.name + ".");
            document.writeln("It is " + myData["topic"]);

        </script>
    </body>
</html>

Related Tutorials