<h1>Inheritance of Constructor</h1>
<div id="satu"></div>
<div id="satu"></div>
<script>
function Lol(){};
var Lola = Lol.prototype = function(){
var satu = document.getElementById('satu');
satu.innerHTML = 'Hello, Indonesia';
}
var a = new Lola(); // printing 'Hello, Indonesia';
</script>
No comments:
Post a Comment