+ 2

How you can make that a variable = a DOM?

Please help me

7th Jan 2017, 1:35 AM
Claas Leo
Claas Leo - avatar
4 Answers
+ 3
you want the whole DOM? why? just use document. If you want the anchors <a>, use (...)getElementByTagName('a') and assign that to a var. then you can loop it like an array
7th Jan 2017, 1:55 AM
Nahuel
Nahuel - avatar
+ 1
The object "document" is the root of document or DOM. for example document.body.innerHTML ="hola";
7th Jan 2017, 2:31 AM
Guzman(Orlando Fl)
Guzman(Orlando Fl) - avatar
+ 1
I need a js variabl to setup a php variable.
7th Jan 2017, 11:48 AM
Claas Leo
Claas Leo - avatar
0
Javascript also has document.getElementById('element-id-attr). i.e. var UsernameDOM = document.getelementById('usersname'); UsernameDOM.innerHTML ="The User's Name";
7th Jan 2017, 3:32 AM
Louis Milotte
Louis Milotte - avatar