{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
©Copyright ©\n",
" \n",
" Yanan Wu
All rights reserved
` element with id='location'\n",
"\n",
"- The most common way to access an element is to use the `id` of the element\n",
"\n",
"- The `innerHTML` is used to get the values of element"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2. Events in JS\n",
"Events are things that happen in the web page you are programming\n",
"\n",
"- The user selects, clicks, or hovers the cursor over a certain element\n",
"\n",
"- Common events: `onclick`, `onmouseover`, `onchange`\n",
"\n",
"HTML allows event handler attributes, with JavaScript code, to be added to HTML elements.\n",
"\n",
"`