text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
there followed by an exclamation point
2,780.42
5.49
so I've extracted the name from the form
2,783.38
4.389
get me the input field where they type
2,785.91
3.839
to the name get access to its value and
2,787.769
4.32
then I'm displaying an alert that is
2,789.749
5.401
going to say hello to that person for
2,792.089
7.71
example and so now for refresh the page
2,795.15
8.04
I type in my name I press submit I get
2,799.799
4.891
an alert that says hello Brian
2,803.19
4.859
press ok I can try it again I can type
2,804.69
5.099
in something like David it press submit
2,808.049
4.55
and now the page says hello David
2,809.789
5.101
so here again we've been able to combine
2,812.599
4.99
event listeners and functions and query
2,814.89
5.31
selector to be able to both read
2,817.589
4.351
information from the page in order to
2,820.2
2.76
say get me
2,821.94
3.36
this particular HTML element find me an
2,822.96
4.71
HTML element and access like what the
2,825.3
4.02
user typed into it the dot value
2,827.67
3.39
property that gets me what the user
2,829.32
3.69
typed into an input field and we've been
2,831.06
3.57
able to combine that with event
2,833.01
3.09
listeners and alerts that are able to
2,834.63
4.14
actually respond dynamically to when a
2,836.1
4.5
user submits the form or when the entire
2,838.77
3.99
content of the page is done loading in
2,840.6
3.66
order to produce some interesting
2,842.76
4.8
effects as well but it turns out we can
2,844.26
6.03
do more than just change like the HTML
2,847.56
4.98
that is contained within an element we
2,850.29
4.74
can also change CSS as well change the
2,852.54
4.62
style properties of a particular element
2,855.03
4.62
as well so let's go ahead and see an
2,857.16
4.89
example of that I'll go ahead and create
2,859.65
5.25
a new file then I'll call colors HTML
2,862.05
4.92
and inside of colors I'll include the
2,864.9
5.88
same standard HTML boilerplate code that
2,866.97
5.34
we often start with a head section with
2,870.78
4.71
a title and a body section and inside of
2,872.31
5.4
the body of this page I'm going to
2,875.49
5.58
display a heading that just says hello
2,877.71
5.61
for example and maybe I'll give it an ID
2,881.07
4.38
just so I can reference it by name maybe
2,883.32
5.34
it has an ID of hello and then I'll have
2,885.45
6.15
three buttons I'll have a button called
2,888.66
6.54
read a button called blue and then a
2,891.6
7.11
button called green for example where
2,895.2
7.14
now if I open up colors dot HTML here's
2,898.71
5.76
what I see I see a big heading that says
2,902.34
4.2
hello and then I see three buttons red
2,904.47
3.48
blue and green but of course right now
2,906.54
3.9
these buttons don't actually do anything
2,907.95
4.5
how do I get the buttons to do something
2,910.44
4.02
well that's where JavaScript's going to
2,912.45
3.99
come in I'll add a script tag to the top
2,914.46
4.35
of my page and I only want to run this
2,916.44
4.05
JavaScript when the Dom is done loading
2,918.81
3.87
so again we'll use the same syntax as
2,920.49
5.42
before document dot add eventlistener
2,922.68
7.14
Dom content loaded and then run this
2,925.91
6.1
function to say everything in between
2,929.82
4.44
these curly braces this is all the code
2,932.01
4.05
that should run once the page is done
2,934.26
3.81
loading and what I'd really like to do
2,936.06
4.2
is get at these three buttons and say
2,938.07
3.48
when you click on each one of them do
2,940.26
2.55
something different like change the
2,941.55
3.93
color of a particular HTML element and
2,942.81
4.29
in order to do that I need some way of
2,945.48
3.63
uniquely referencing these buttons so to
2,947.1
3.18
do that I'm going to give them all IDs
2,949.11
3.78
this button will have an ID of red this
2,950.28
4.59
button will have an ID of blue this
2,952.89
3.69
button will have an ID of green
2,954.87
3.45
unique names I can give to the buttons
2,956.58
4.17
in HTML such that in JavaScript
2,958.32
5.97
I'm later able to reference them so what
2,960.75
5.64
I what do I include now here inside of
2,964.29
3.18
my JavaScript code
2,966.39
4.5
well let me say document dot query
2,967.47
8.13
selector hash read to say get me the
2,970.89
8.4
element whose ID is read and when you're
2,975.6
6.27
clicked on on click go ahead and run
2,979.29
4.14
this function
2,981.87
3.63
what should the function do well I want
2,983.43
4.59
to take this h1 element and change its
2,985.5
5.04
color to red I want to change the font
2,988.02
4.62
color to red and I'll leave a comment to
2,990.54
3.9
myself in JavaScript the way you can
2,992.64
3.21
leave a comment just a document what
2,994.44
3.24
you're doing is using these two slashes
2,995.85
3.78
the two slashes indicate everything
2,997.68
3.66
after that on the page is going to be a
2,999.63
3.78
comment browser will ignore it but it
3,001.34
3.78
can be useful to use a programmer and to
3,003.41
3.18
someone who's reading your code to be
3,005.12
3.03
able to see what it is that you're
3,006.59
4.29
describing here on the page and now what
3,008.15
5.25
I'd like to do is document query
3,010.88
6.39