I am a New Bie in Programming, I was creating a code by which how can i limit the user to enter value within defined numbers.

I want the user to enter field value not more than 35 characters or length.

Here is My Written Code but it's is not working 

i use onkeyup methodology

```js
function handleChange() {
    var x = document.getElementById("fname");
    var y = document.getElementById("lname");
    if ((x.value > 35) || (y.value > 35))
    {
      alert("value should less than 35");
    }
  }
```

```html
<form onkeyup="handleChange()">
    Enter your fname: <input type="text" id="fname">
    Enter your lname: <input type="text" id="lname">
</form>
```