---
title: "JavaScript Object Methods"  
description: "JavaScript Object Methods"  
author: "Norman Reedus"  
published: 2016-03-28  
updated: 2016-03-28  
canonical: https://www.mindstick.com/forum/34087/javascript-object-methods  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# JavaScript Object Methods

We want to use [JavaScript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript) Object Methods. How to use this please help me.

## Replies

### Reply by Anonymous User

```
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head>   <title>The JavaScript Object Methods</title> </head><body>      <p id="Name"></p>     <script>      function person(firstName, lastName, age, eyeColor) {          this.firstName = firstName;          this.lastName = lastName;          this.age = age;          this.eyeColor = eyeColor;          this.changeLastName = function (name) {              this.lastName = name;          }
          this.changeFirstName = function (name) {              this.firstName = name;          }      }      var myfriend = new person("Sally", "Rally", 48, "green");      myfriend.changeFirstName('Ashok');      myfriend.changeLastName('Patel');     document.getElementById("Name").innerHTML= ("My friend name is " + myfriend.firstName + myfriend.lastName);</script></body></html>
```

![JavaScript Object Methods](https://www.mindstick.com/mindstickforums/9ddd0111-5ba5-407b-a911-bea2c685d839/images/42c72739-a66e-4a6d-8df5-065619fcc86e.png)


---

Original Source: https://www.mindstick.com/forum/34087/javascript-object-methods

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
