How to reach javascript object property
I have some radio buttons like to
<input type="radio" checked="checked" value="0" id="paramsmenu_images0" name="params[menu_images]">
I would like to reach this in javascript somehow like this:
console.log(document.adminForm.params[menu开发者_开发问答_images]);
Of course it doesn't work, so how can I reach it?
Is this OK?
document.getElementsByName('params[menu_images]')
You can also iterate over document.adminForm.elements
to find your form element...
document.getElementById('paramsmenu_images0')
will give you the dom element if that's what you want.
精彩评论