0
Following...
I want to find an element (form) that is inside a block. I use the .getElementById();
to get this block.
After I get the block, I want to find the form that’s in this block so I can include an element before this form. I’m trying this way, and so far, I haven’t been able:
javascript
var boardElem = document.getElementById('board-01');
var formEl = boardElem.children('#formNewTask');
It didn’t work... so I tried to use it like this too:
var formEl = boardElem.getElementById('formNewTask');
And the error generated is this:
Uncaught Typeerror: boardElem.getElementById is not a Function
I’m used to jQuery. But I’m developing a project without using the framework. Some light?
Thank you!
Do you have the form id at hand? It is known?
– Danilo Gomes
Another question: is there any other form on the page?
– Danilo Gomes
I just got it, Danilo! The id was "#formNewTask". There will be several forms on the page yes (I shouldn’t even try to pick up the ID). Anyway, thank you very much! :)
– romulobastos