# Separating JavaScript Behavior from Web Page Structure and Presentation

DevFeed: [Separating JavaScript Behavior from Web Page Structure and Presentation](<https://devfeed.tech/articles/unobtrusive-js-37868.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/unobtrusive-js/>)

Author: Carlos Alexandro Becker

Published: 2013-01-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [Web](<https://devfeed.tech/topics/web.md>), [Rails](<https://devfeed.tech/topics/rails.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [dashboards](<https://devfeed.tech/topics/dashboards.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [dashboard](<https://devfeed.tech/tags/dashboard.md>), [data](<https://devfeed.tech/tags/data.md>), [rails](<https://devfeed.tech/tags/rails.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [structure](<https://devfeed.tech/tags/structure.md>), [web](<https://devfeed.tech/tags/web.md>)

## AI overview

This tutorial explains unobtrusive JavaScript by separating a web page's behavior from its structure and presentation. It uses examples involving JavaScript bindings, Rails, charts, dashboards, and data attributes.

## Source excerpt

This article is the second of a series of articles, where could be any given number ... One of the principles of Unobtrusive JS is the "separation of functionality (the "behavior layer") from a Web page's structure/content and presentation". A small example: better: And in our JS file: Notice that with this, you don't even need to expose the method from , you can do these bindings in the object declaration.