Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up New Way to Access DOM

    Hi All

    Suprisingly it was new for me, when i was working with a core javascript code and found something very interesting there.

    It was a new way DOM elements are being processed in javascript. I am not sure whether this is pure luck or something really interesting and innovating. Let me help decide this...

    Problem:
    It was a simple textbox like
    Code:
    <input type="text" id="userName" />
    On a button click i just wrote like :
    Code:
    alert(userName.value)
    and surprisingly it worked.

    I am not getting how this is being treated as a DOM object. i debugged and found complete DOM object is available once we use element id as a variable in javascript.

    I am not getting exact reason why it is happening and if possible how it is getting converted as a DOM object, and if its so, so what's the use of javascript/jquery left to make DOM for html elements.

    kindly help me resolve this, wishing for a innovation soon

    Thanks
    Jatin
    Last edited by jatinkindra; 05-15-2012 at 02:14 PM. Reason: Spelling Mistake

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,860
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    (Un)fortunately it's just an IE bug! See http://webbugtrack.blogspot.in/2007/...lution-in.html
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your response.

    But i am just wondering i checked it will all browsers namely IE, Chrome and FF. It worked same in all..


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •