JavaScript beginner tutorial 24 – referencing elements in JavaScript




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:

facebook group:
https://www.facebook.com/quentin.watt
————————————————————-

Original source


37 responses to “JavaScript beginner tutorial 24 – referencing elements in JavaScript”

  1. 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 ?

  2. 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

  3. 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…

  4. +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 🙂

  5. 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

  6. 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?

  7. 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.

  8. 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..

Leave a Reply