Adding and Deleting Properties and Methods - Javascript Language Basics

Javascript examples for Language Basics:Introduction

Introduction

Adding a New Property to an Object

Demo Code

ResultView the demo in separate window

<!DOCTYPE HTML>
<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        <script type="text/javascript">
            var myData = {//www.  ja  v  a  2 s  . c  om
                name: "java2s.com",
                topic: "CSS",
            };

            myData.dayOfWeek = "Monday";
        </script>
    </body>
</html>

Related Tutorials