i have some code.. html <input type=hidden name='ge_1' value='0'> <input type=hidden name='ge_2' value='0'> HTML: JS var chosen; chosen='ge'+'_'+gamecount; document.getElementByName(chosen).value=0; HTML: how i change the value ? its write me the he have problem.
You should give the <input> fields an ID as well as a name. Change them to this: <input type=hidden name='ge_1' id='ge_1' value='0'> <input type=hidden name='ge_2' id='ge_1' value='0'> Code (markup): And if they are located within a <form> (which they probably are since they are type=hidden), use this code to change their values: var chosen = 'ge' + '_' + gamecount; eval("document.forms[0]." + chosen).value = 0; Code (markup):