text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
particular notation for functions called
3,691.38
3.87
the arrow notation for functions and
3,693.42
3.18
I'll just show it to you because it'll
3,695.25
3.45
come up but often times instead of using
3,696.6
3.93
the keyword function before introducing
3,698.7
3.72
a function you'll just have something
3,700.53
6.63
like button and then arrow the curly
3,702.42
6.12
braces and strictly speaking you don't
3,707.16
2.67
even need the parentheses around the
3,708.54
3.99
input where button arrow and then in
3,709.83
4.74
these curly braces some code just means
3,712.53
3.48
here is going to be a function that
3,714.57
3.63
takes as input a variable called button
3,716.01
5.16
and then runs this particular block of
3,718.2
5.16
code when that function is run and
3,721.17
4.23
likewise if a function takes no input
3,723.36
3.75
like this function up here you could
3,725.4
3.6
express it using arrow notation with
3,727.11
5.37
just parentheses a arrow block and so
3,729
5.16
this is often a notation that you'll see
3,732.48
3.57
in Java scripts if you ever see it know
3,734.16
3.33
that that's really just shorthand for
3,736.05
3.09
creating a function whatever is to the
3,737.49
3.75
left of the arrow sign is the input to
3,739.14
3.66
the function and whatever is to the
3,741.24
3.3
right of the arrow is what code should
3,742.8
3.9
actually run when the function body gets
3,744.54
4.05
executed when the function is called
3,746.7
4.53
upon so what other changes might we want
3,748.59
5.13
to make two colors dot HTML well if we
3,751.23
4.41
look back at colors dot HTML here's what
3,753.72
3.21
it looks like now we've got a heading
3,755.64
2.78
that says hello and then
3,756.93
3.439
to change the color to red or blue or
3,758.42
4.439
green for example we might instead if we
3,760.369
4.381
want the user to choose from one from a
3,762.859
3.901
number of options decide upon the user
3,764.75
4.349
interface choice of using a drop-down
3,766.76
3.809
instead of a bunch of buttons for
3,769.099
3.45
example and JavaScript supports that as
3,770.569
3.061
well and we'll use this as an
3,772.549
2.911
opportunity to explore some of the other
3,773.63
3.719
event handlers that exist within
3,775.46
5.19
JavaScript so for example instead of
3,777.349
5.52
having these all inside of buttons I can
3,780.65
3.87
make my life a little bit easier by
3,782.869
4.351
making this a select drop-down where the
3,784.52
4.829
Select is going to have an option whose
3,787.22
4.139
value is I'll say black is the default
3,789.349
3.99
option and I'll say black and then we'll
3,791.359
3.871
add another option whose value is red
3,793.339
4.591
and then we say red and the value is
3,795.23
4.41
what we'll get in JavaScript when we try
3,797.93
3.149
and extract the value of a particular
3,799.64
3.719
select drop-down well it's in between
3,801.079
4.201
the option tags themselves is what the
3,803.359
3.631
user is going to see on the page when
3,805.28
2.7
they actually view it so I'm
3,806.99
3.569
capitalizing it just for them option
3,807.98
4.139
value equals blue
3,810.559
3.841
that'll be blue and then option value
3,812.119
5.43
equals green and that'll be green so now
3,814.4
5.429
what the user sees is they see hello and
3,817.549
3.78
then a drop-down menu where they can
3,819.829
3.54
choose from a list of colors rather than
3,821.329
4.5
click buttons in order to do so and now
3,823.369
4.44
of course this select drop-down doesn't
3,825.829
3.661
do anything at the moment but I can
3,827.809
4.591
modify it so that it does so now instead
3,829.49
4.92
of selecting for all of the buttons and
3,832.4
3.54
doing something with all the buttons we
3,834.41
3.419
don't have any buttons anymore what I do
3,835.94
6.75
have is I have a select drop-down and
3,837.829
7.411
now just as we've seen like on click to
3,842.69
3.96
say when you click on something as we've
3,845.24
3.089
seen Dom content loaded as an event
3,846.65
4.11
there's another event called on change
3,848.329
4.111
which applies to things like select
3,850.76
4.26
dropdowns where when something changes
3,852.44
3.899
in the select drop-down when a user
3,855.02
2.64
chooses something different
3,856.339
4.23
I can run some code for example so I can
3,857.66
5.1
run a function that in this case is
3,860.569
4.55
going to take document query selector
3,862.76
3.599
hello
3,865.119
3.48
meaning get me the hello HTML element
3,866.359
4.861
change its style what part of the style
3,868.599
4.96
changed its color and I want to change
3,871.22
3.66
it to something I want to change it to
3,873.559
5.04
the value of this select drop-down but
3,874.88
5.16
how do I get access to this particular
3,878.599
4.171
select drop-down well in JavaScript we
3,880.04
4.95
have access to a special value called
3,882.77
5.64
this and this has special meaning in
3,884.99
5.01
JavaScript and its meaning varies based
3,888.41
3.84
on context but in the context of an
3,890
3.96
event handler a function that is called
3,892.25
4.29
when a particular event happens this is
3,893.96
4.47
going to be a special keyword that
3,896.54
4.32
always refers to the thing that received
3,898.43
3.3