Today I learned and experimented with the “DOM” or The Document Object Model. The DOM, through the power of the “getElementById” method, gives the coder the ability to send and receive data or text information between forms in the script. The script is then identified within the HTML or webpage. Put simply, if there were a form that prompted a user to input their name or date of birth, the form would send that information to the DOM which would then be expressed in the script. The “getElement” was used within our HTML by identifying a paragraph tag to the class or function that needs to send or relay that information.

A screenshot of the demonstration that was completed using the getElement.

For instance, we created a “car” class and described the “car” within the class brackets. We labeled the car as a 2020 Ford with a V20 engine. All three descriptors were tagged, then we used the “getElement” in the manner of “getElementById.innerHTML” and captioning the tag we wanted displayed in the HTML file. Once we completed this and used the caption “…Id.innerHTML.car_class.year” the characters “2020” displayed within the html and that perfectly demonstrated the desired outcome. I was very pleased to learn such a fundamental step in coding, I imagine using the DOM and having a cohesive script to run information between the script and HTML will benefit me greatly going forward.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s