mercredi 22 avril 2015

Simple javascript print

Why cant I get Object elements? I'm trying to print code element on html page

HTML:

<!DOCTYPE html>
<html>

<head>
  <link rel='stylesheet' href='style.css' />
  <script src='script.js'></script>
</head>

<body>
  <script>
    console.log(omni1.min);
  </script>
</body>

</html>

script.js file

var omni1 = {
    min:100,
    sms:300,
    int:500
};
var omni2 = {
    min:300,
    sms:350,
    int:1000
};
var omni3 = {
    min:60,
    sms:100,
    int:3000
};

How to call object methods to html page?




Aucun commentaire:

Enregistrer un commentaire