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 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2007
    Location
    Quebec, Canada
    Posts
    64
    Thanks
    4
    Thanked 3 Times in 3 Posts

    Access text node inside tag (jQuery)

    Hello, I'd like to access a text node inside a tag

    Tried a mix of contents() and find(), can't seem to be able to pass it to a variable

    Are those even the right functions to allow me to do it?

    Thanks!

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,923
    Thanks
    56
    Thanked 548 Times in 545 Posts
    you are probably looking for either html() or text(), or maybe even val(), depending on what the tag is.

    btw, you're better off posting in the Frameworks sub-branch - this has nothing to do with the DOM or JSON

  • Users who have thanked xelawho for this post:

    vexen (10-07-2012)


  •  

    Posting Permissions

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