Display first name by extracting information from the person object. - Javascript Object

Javascript examples for Object:Quiz

Description

Display first name by extracting information from the person object.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var person = {firstName:"A", lastName:"B"};
document.getElementById("demo").innerHTML = person.firstName;
</script>//from w  w  w . j a  v  a 2s  . com

</body>
</html>

Related Tutorials