Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts
Original source
33 responses to “Beginner JavaScript Tutorial – 22 – Event Handlers”
Nothing in my code is showing up when I load up me browser(I checked all the tags and they matched up)
for(x=0;x<10;x++;){
alert("Hi");
}
<input type="button" value="touch her" onClick="alert('please Rebecca is only fourteen!'); alert('the FBI has been informed');"/>
from this actual java scripts begins for a basic programmer…anyone in 2018???
Sounds somewhat like Listeners in Java. ….. onclick…. onmousevent.. ontouch
this is the bad way to use event handlers
you better do it like this:
function alerts() {
alert("ahh!");
alert("two times!");
}
for html code:
<button onclick="alerts()">touch me</button>
Cool. You make teaching so easy. Much better than Udemy. Thanks
I like his teaching style. Great for beginners like me. Hope most of this is still relevant since it was done seven years ago.
Thanks for this video Education
and all videos
It works regardless of case, I tried it with the most bizarre cases like Onclick, oNclick, onclick, ONclick, ONCLICK, onClick etc., it always worked. Check out w3school's JavaScript tutorials. You can change the code there to see what happens.
20 second tutorial
Can you come to my college and replace my web teacher please
bucky,i see what you did there
Why didn't you include the script tags? Aren't they required?
It's HTML 5 now, onClick is now onclick.
My google Chrome crashes everytime i hit the button to load up the alert box. can anyone help me?
i want to call a function for onClick but not the same every time ,, like when user enters something it should be take as function call for onClick
for EX- if user enters in form box as boston –> onClick alert should come as welcome boston
How about using the for loop to make the pop box appear as many times as you want like this;
form>
<input type="button" value="Click me" onClick = "for(x=0; x < 10; x++) {alert('how dee!!!');}" />
</form>
As a c++ and java programmer I have to jump directly on this videos from first video!!! gr8 :))
I don't think we need form tags to make some input tags ,what say guys???
Danke Bucky 😘🙏👏✌️😃
You can write
<button type="button" onclick="Hello!">Click me</button>
without having form and input tags. And the result stays the same.
Great tutorial. First piece of JS I put in my codepen project. Awesome!
touch me like you do
i dont think you necessarily need capital 'c' in onclick as it worked for me without it as well
i donno but this one is not working..can anybody help me..?
Did you ever notice you never say button you say "bu-un."? Is that boston accent?
I tried to write 'Don't do that' but the apostrophe between n and t broke the script. Is there a way to punctuate with apostrophes while using single quote tags?
"Now let's add event handlers to spice it up a bit" ~> rubbing-hands 😀
how to use 2 input buttons??
HOW TO OPEN AN IMAGE ON CLICK PLS HELP ?
the new Microsoft Edge don't have the alert(); prevention xD
having fun trolling people with loops xDDD
As you said here https://youtu.be/9rvB27xXO_I?list=PL46F0A159EC02DF82&t=265, the statement should end with semicolon is wrong. It works without semicolon also.
In https://youtu.be/9rvB27xXO_I?list=PL46F0A159EC02DF82&t=185, you said 'c' of 'onClick' should be capitalized. It is wrong. Small 'c' also works.