Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website CSS: Cascading Style Sheets Take a Mobile-First Approach

id attribute can convert ANY HTML element into a div or encapsulate it?!

The ultimate hack or what? Is this for real? :o

It can turn anything into a div element that can be moved around/positioned anywhere around the HTML page?!

Magic :o

1 Answer

Steven Parker
Steven Parker
231,269 Points

No, adding an ID attribute does not change the element type into a div.

Also, an ID attribute is just one way you can select a specific element. But whichever method you use, once you have an element selected in your code, you can manipulate that element in a variety of ways, including moving where it will be rendered on the page.

I'm not sure what you mean by "ultimate hack", but this is certainly of the features that makes DOM manipulation very useful.

If you don't mind the question, what's DOM?

Steven Parker
Steven Parker
231,269 Points

Oh, I was expecting that term would have been introduced in your course. DOM stands for "Document Object Model" and refers to the tree-like structure of HTML documents which allows programs and scripts to dynamically access and update the content, structure, and style of the document.