Created
September 25, 2017 16:35
-
-
Save victor123/9b18f0aabdfa44b349d61ef14966e4fe to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/qivowar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<p id="name"> </p> | |
<p id="comp"> </p> | |
<p id="sal"> </p> | |
<script id="jsbin-javascript"> | |
function emp (name,company,salary ) { | |
this.name = name; | |
this.company = company; | |
this.salary = salary || 1000 | |
this.increaseSal = function() { | |
return this.salary + 6000 | |
} | |
} | |
var emp1 = new emp ("victor","SVN",2000); | |
document.getElementById("name").innerHTML = emp1.name; | |
document.getElementById("comp").innerHTML = emp1.company; | |
document.getElementById("sal").innerHTML = emp1.increaseSal(); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
function emp (name,company,salary ) { | |
this.name = name; | |
this.company = company; | |
this.salary = salary || 1000 | |
this.increaseSal = function() { | |
return this.salary + 6000 | |
} | |
} | |
var emp1 = new emp ("victor","SVN",2000); | |
document.getElementById("name").innerHTML = emp1.name; | |
document.getElementById("comp").innerHTML = emp1.company; | |
document.getElementById("sal").innerHTML = emp1.increaseSal();</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function emp (name,company,salary ) { | |
this.name = name; | |
this.company = company; | |
this.salary = salary || 1000 | |
this.increaseSal = function() { | |
return this.salary + 6000 | |
} | |
} | |
var emp1 = new emp ("victor","SVN",2000); | |
document.getElementById("name").innerHTML = emp1.name; | |
document.getElementById("comp").innerHTML = emp1.company; | |
document.getElementById("sal").innerHTML = emp1.increaseSal(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment