Let put it in other ways, as it looks like you understood nothing form what Logic Ali
1. There is no getElementByName()
, and it returns a collection
, not a single element. Or you may use getElementById()
are not the same thing.
must start with a letter. Thus: id="2" and name="2" are HTML illegal.
3. window.frames means the second frame/iframe (counted from top to bottom) window.frames['2'] means nothing, as I said, because name can not start with a digit.
4. window.frames is the reference of the iframe object, not the reference of the document loaded in the iframe.
But it depends also on which kind of element has the name "msgtitle". If it is a form's element, it will work. If not, you'd better give that object an id, and use getElementById() instead.