Append Value

How can I append the value to an input using javascript. I need the value to match an ID that I have in my database so that when I press the accept of deny button it will update mysql.

I have this…

input2.value = ‘deny’;

I think I need this to be something like…

input2.value = ‘deny[$id]’;

What’s the best way to do this?

input2.value=input2.value+“[id]”;