1D0-720 · Question #102
How does JavaScript differ from a language like Python in web development?
The correct answer is A. JavaScript can manipulate the DOM of a web page. JavaScript's defining role in web development is its native ability to manipulate the DOM (Document Object Model), allowing it to dynamically update content, respond to user events, and modify page structure directly in the browser - making A correct. Why the distractors fail…
Question
How does JavaScript differ from a language like Python in web development?
Options
- AJavaScript can manipulate the DOM of a web page.
- BJavaScript is mainly used for server-side scripting.
- CPython is primarily used for client-side scripting.
- DPython can be embedded directly into HTML.
How the community answered
(37 responses)- A89% (33)
- B3% (1)
- C3% (1)
- D5% (2)
Explanation
JavaScript's defining role in web development is its native ability to manipulate the DOM (Document Object Model), allowing it to dynamically update content, respond to user events, and modify page structure directly in the browser - making A correct.
Why the distractors fail:
- B is wrong because JavaScript is primarily a client-side language; while Node.js enables server-side use, that's not its defining characteristic in web development context.
- C reverses reality - Python is predominantly a server-side language (Django, Flask), not client-side.
- D is wrong because Python cannot be natively embedded in HTML the way JavaScript can with
<script>tags; browsers don't execute Python.
Memory tip: Think "JS = Browser's language" - it's the only language browsers run natively, which is exactly why DOM manipulation belongs to JavaScript, not Python.
Topics
Community Discussion
No community discussion yet for this question.