Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/27/2017 in all areas

  1. There are three aspects to take into account in a web page: Content: HTML Presentation: CSS Behavior: Javascript The same way we want to separate content from presentation, we also want to separate content from behavior. Javascript should only be inside <script> elements, CSS should only be in <style> or <link> elements and HTML should not be polluted with attributes concerning behavior and presentation. You wouldn't use align and bgcolor attributes, so why would you use onclick attributes? In your original code, otherTongue is restricted to the local scope of the function it was declared in, it's not accessible from outside. That's why the onchange event attribute can't find it, the event attribute is looking for a global function.
    1 point
×
×
  • Create New...