<html>
<head>
<script>
function start(){
var game=new Game();
game.chart();
}
function Game(){
alert("Game");
var charA=new CharA();
charA.createDIV();
this.chart=function(){
alert("chart");
}
}
function CharA(){
alert("CharA");
this.createDIV=function(){
alert("createDIV");
}
}
</script>
</head>
<body>
<button οnclick="start()">test</button>
</body>
<head>
<script>
function start(){
var game=new Game();
game.chart();
}
function Game(){
alert("Game");
var charA=new CharA();
charA.createDIV();
this.chart=function(){
alert("chart");
}
}
function CharA(){
alert("CharA");
this.createDIV=function(){
alert("createDIV");
}
}
</script>
</head>
<body>
<button οnclick="start()">test</button>
</body>
</html>