In this tutorial I show you to reference elements on your web page using the document.getElementById() method.
Don’t forget to subscribe:
http://www.youtube.com/user/QuentinWatt
For collaborations and business inquiries, please contact via Channel Pages: http://ChannelPages.com/QuentinWatt Social links:
————————————————————-
Add me on twitter:
Tweets by QuentinWatt
facebook group:
https://www.facebook.com/quentin.watt
————————————————————-
Original source
37 responses to “JavaScript beginner tutorial 24 – referencing elements in JavaScript”
How do you REVERSE the process where when I click on " That tickles " it will reverse to " click me " ?
Thank you man! You are just awesome….
Wow, you explained it very well! I recommend this tutorial to everybody!
+Quentin Watt Tutorials can the on click event and id function be used in JavaScript
great tutorial Quentin very much helpful after the message i sent you the other day 🙂
Hi. Nice videos!!
I have a query however, which I don't understand the logic behind.
The code between <p> and </p> and its relation, so basically why did you define id = "para"? How is it co0ordinating with the JS script ?
Thank you so much, this video cleared up a lot of what I was confused about (relationship among objects, properties and methods). Terrific!
love the way you explain mate!! much better than our professor. Keep up the good work 🙂
Thank you so much for your efforts!
broo…ur teaching is awsuummm..lovedddd it!!!!!
So in para.innerHTML = "This tickles" the "innerHTML" is property (not a method) is that correct?
i did what you told but i dont have the smae results. when i click the pragraph it doesnt change and i tried it both ways
can you please help me
This was great!
Awesome
Another very informative video…
Thank you. Great job
Quintin, thanks! You explained things with so much clarity.
Quintin, thanks! You explain things with so much clarity.
took me more than 8 years to learn this. Thanks Thats an awesome tutorials
Hello Quentin. Thank you very much for everything you do here. It is very generous of you that you put the time and energy to help others. I have a question. Along watching your tutorials, I am also reading the popular javascript and jquery book by Jon Duckett. In his book he says that innerHTML method can cause a lot of security risk to the website. He doesn't recommend this method. What is your thought on that? Thanks
hello Mr. Watt.. please let me ask you something:
is there a way to run 2 event on the same object? one following the other? let me explain my self, if you use the same example of this video but instead of use the event onclick you use the event onmouseover, then it run the function, but when the mouse quit hovering, with the event onmouseout, make the paragraph go back to the original state. i hope i explained my self and would be possible for you to answer me… thank you for your video tutorials…
How to make onclick event in javascript?
+Quentin Watt Nice video's, my lil girl somewhat respects Yt for the odd videos but I would like her to get to get more out of YouTube if so, so I rate your tutorials, they are nice and clear as I am a 20 year programmer myself I can honestly say you have great teaching skills and knowledge, most of all I am happy you keep the language clean but if you were to say something odd I totally understand frustration now n then 🙂
If anyone is interested in the oculus rift virtual reality headset there is this 3d web browser called janusvr that is looking for more programmers or game devs to help come expand it so if anybody is interested in helping expand the 3D web check it out. it's easy as 3 steps to have your own 3D space where you can put music, pictures, 3D objects, and animations. just search janusvr on youtube if you want to see what it looks like! i believe this is the next big thing. Also it's multiplayer so you can hop in with friends and search the web together. You can also import your own 3d avatars
I like how you explain things very clearly and methodically, really helps, thanks!
Tutorial.Quality.ThumbsUp
document.write("cheers Quentin");
Hi Quentin, I'm having a problem I can't handle (I've been trying for a few days)… What I'm trying to do is to put the onClick event on a separate .js file. I've been working with a separate script for all your videos, and it worked until now. My HTML code is the same as yours but using src = "mainscript.js" in the script tag. Also, I removed the onclick from the p tag. Now, my JS code is this:
var para = document.getElementById("para")
para.onClick = change;
function change(){
para.innerHTML = "That tickles";
}
Does someone happen to know what the problem is?
When do we use double and single quotes in javascript?
I see you already have point me to the property's
This Quentin lives in Africa, if he was living here and born here in america, he would be running his own company. Its unfortunate that you might at times feel limited but you over come it. I know javascript, html and php in the future thanks to a guy in Africa.
Keep it up 🙂
I'm enjoying your tutorials. Thank you Quentin!
FINALLY! i've been going through every JavaScript tutorial wondering to myself WHERE THE FUCK AM I GOING TO USE THIS STUFF?! now it gets exciting.
So understandably.
Thanks for all the Videos man!
I've been followings these on and off for a little while. You teach at a good tempo, especially for an old boy like me!
nice up man
Is innerHTML method only applicable to <p> tags or can it be applied to others..like for example i need add some tags into a div using JS with the help of innerHTML is that possible ?? i know should be trying this out or browsing..but for the sake of others who might have this doubt em asking here..