Question: I have a button that looks like this:

```
<button id="button-1" onclick="adjustValue(1, 1, 30, 1, 'user');">Test</button>

```

The function that I currently have with this button is working properly. However, what can I add to the function to allow it to edit the values of the onclick field?

```
function adjustValue() {
    // Something to alter the field values
}

```

For instance, after the function is ran, I want it to change the onclick field of the button. (The numbers in the example below are random.)

```
<button id="button-1" onclick="adjustValue(1, 2, 60, 1, 'user');">Test</button>

```

I believe I would need to use something with `document.getElementById`. However, I'm still new to JavaScript and I don't know how to accomplish this.

Answer: 
If you only want to analyse a specific `TypeSymbol`, use pattern matching. Here is an example.

```
TypeSymbol t;
if (class(l,_) := t) {
  println(l);
}

```

or in a comprehension

```
{ l | <_,class(l,_)> <- m3@types};

```

or as part of a lookup in a comprehension:

```
{ <v, l> | <_,v> <- m3@containment, isVariable(v), class(l,_) <- m3@types[v]}; 

```
You could use the `containment` relation from the M3 model. All local variables are declared in the `declarations` relation, but they also appear in `containment`. If you want to get all the variables in a method `m`, you can have a look at `containment[m]` and filter on the `java+variable` scheme. 

Interesting corner cases are when a method contains an anonymous class. You have to look at bit further in `containment` (like a transitive closure) if you need to filter nested variables used in 
anonymous nested classes as well.

By the way, the M3 model has utility predicates `isVariable`, `isClass`, etc. and also `classes(M3)`, etc.