Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addElement() {
- var foo = document.createElement('p');
- foo.id = "bar";
- document.body.appendChild(foo);
- }
- function getElement() {
- alert(document.getElementById('bar'));
- }
- addElement();
- getElement();
Add Comment
Please, Sign In to add comment