text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
press submit and alright foo now shows | 4,354.4 | 3.99 |
up I type in something like a right to | 4,356.89 | 3.93 |
leave that type in bar bar now shows up | 4,358.39 | 5.19 |
I'd have been Baz Baz no shows up now | 4,360.82 | 4.59 |
one minor user interface annoyance is | 4,363.58 | 3.27 |
that it seems that every time I submit a | 4,365.41 | 4.35 |
new task this input field retains the | 4,366.85 | 4.89 |
value of what it used to be and that's | 4,369.76 | 3.84 |
probably not what I want because I'd | 4,371.74 | 3.21 |
rather it just clear out I've already | 4,373.6 | 2.7 |
submitted the task no need for it to | 4,374.95 | 3.27 |
stay there but that's easy to manipulate | 4,376.3 | 4.17 |
in JavaScript if I want to clear out | 4,378.22 | 4.2 |
this input field the input field whose | 4,380.47 | 4.98 |
ID is task then all I need to do is say | 4,382.42 | 6.93 |
document dot query selector task get me | 4,385.45 | 6.96 |
that input field change its value equal | 4,389.35 | 5.46 |
to the empty string equal to nothing | 4,392.41 | 4.89 |
just to say clear out the value of what | 4,394.81 | 4.02 |
happens to be inside of that input field | 4,397.3 | 3.81 |
right now and now if i refresh the page | 4,398.83 | 5.22 |
type in foo press submit input field | 4,401.11 | 4.71 |
clears out and now I can type in | 4,404.05 | 3.6 |
something like bar and then something | 4,405.82 | 4.11 |
like Baz to continue to add tasks as | 4,407.65 | 4.89 |
well now one thing that might be | 4,409.93 | 3.6 |
slightly annoying is that I'm not | 4,412.54 | 3.48 |
careful if I press submit well it | 4,413.53 | 4.74 |
submits the empty string is a task and | 4,416.02 | 4.14 |
so I just get this empty bullet point | 4,418.27 | 4.02 |
that shows up here nice press submit and | 4,420.16 | 3.81 |
I just get all of these empty bullet | 4,422.29 | 3.24 |
points it might be nice from a user | 4,423.97 | 2.939 |
experience perspective | 4,425.53 | 3.45 |
if I were to not allow the user to do | 4,426.909 | 4.141 |
that not allow them to submit a task if | 4,428.98 | 3.719 |
they haven't actually typed something in | 4,431.05 | 4.26 |
to the new task field and we can do that | 4,432.699 | 4.951 |
just by modifying properties of elements | 4,435.31 | 4.02 |
that it turns out that HTML elements | 4,437.65 | 4.319 |
have a property called disabled that can | 4,439.33 | 4.47 |
be true or false that allows us to | 4,441.969 | 5.371 |
disable something like a button so if I | 4,443.8 | 6.21 |
want to disable the submit button one | 4,447.34 | 4.35 |
thing I might want to do first is give | 4,450.01 | 3.99 |
this submit button an ID I'll give it an | 4,451.69 | 4.77 |
ID of submit so that in my JavaScript | 4,454 | 4.38 |
code I can reference the submit button | 4,456.46 | 6.23 |
and now inside of this JavaScript code | 4,458.38 | 7.83 |
when the Dom content is loaded by | 4,462.69 | 7.38 |
default the submit button should be | 4,466.21 | 6.239 |
disabled like when I first load the page | 4,470.07 | 4.39 |
I don't want the submit button to be | 4,472.449 | 3.361 |
enabled because I want the user to type | 4,474.46 | 3.54 |
in a task first before I enable the | 4,475.81 | 4.679 |
submit button so how do I do that well I | 4,478 | 4.949 |
can document query selector get me the | 4,480.489 | 4.261 |
element whose ID is submit get me that | 4,482.949 | 3.571 |
submit button and just said it's | 4,484.75 | 3.92 |
disabled property equal to true | 4,486.52 | 4.29 |
javascript has boolean values true and | 4,488.67 | 4.45 |
false I set the disabled value equal to | 4,490.81 | 5.55 |
true to disable the submit button now if | 4,493.12 | 5.19 |
i refresh the page I can type in a new | 4,496.36 | 3.87 |
task but the submit button is disabled | 4,498.31 | 3.659 |
it doesn't do anything now obviously I | 4,500.23 | 2.969 |
don't want to keep it that way I'd like | 4,501.969 | 2.701 |
it such that as I begin to type things | 4,503.199 | 3.991 |
in then the submit button stops being | 4,504.67 | 4.59 |
disabled disabled get set from true to | 4,507.19 | 5.16 |
false instead and so what I really want | 4,509.26 | 6.209 |
to do is listen for me like pressing | 4,512.35 | 6.059 |
keys on the keyboard and so the way I | 4,515.469 | 5.19 |
can do that is by adding yet another | 4,518.409 | 5.571 |
event listener document query selector | 4,520.659 | 5.58 |
what I want to add a query selector to | 4,523.98 | 3.46 |
what do I want to add an event handler | 4,526.239 | 3.391 |
for well I want to add an event handler | 4,527.44 | 4.049 |
for when I type something into this | 4,529.63 | 4.47 |
input field and this input field has an | 4,531.489 | 5.4 |
ID of tasks so let me go ahead and get | 4,534.1 | 4.59 |
the input field the element whose ideas | 4,536.889 | 5.58 |
tasks and add an on key up handler on | 4,538.69 | 6.36 |
key up again is the event when I lift my | 4,542.469 | 6.27 |
finger off of a key go ahead and run | 4,545.05 | 5.91 |
this function and what should the | 4,548.739 | 3.811 |
function do well it's going to say | 4,550.96 | 4.65 |
document query selector submit set the | 4,552.55 | 5.97 |
disabled property equal to false | 4,555.61 | 5.13 |
and so now here's what we're doing we're | 4,558.52 | 4.02 |
saying by default when I first load the | 4,560.74 | 4.59 |
page take the submit button and disable | 4,562.54 | 5.55 |
it said dot disabled equal to true then | 4,565.33 | 5.52 |
anytime I type a key and my finger comes | 4,568.09 | 4.95 |
off the key that means on key up is the | 4,570.85 | 4.02 |
event that gets triggered run this | 4,573.04 | 3.69 |
function and what the function is going | 4,574.87 | 3.99 |
to do is take that same submit button | 4,576.73 | 4.41 |
and set its disabled property equal to | 4,578.86 | 4.32 |
false so now instead of being disabled | 4,581.14 | 6.54 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.