<html> <body> <form> <input name="d[2]" /> </form> <script> document.querySelector('form').elements['d[2]'].value = 't' </script> </body> </html>