This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Question .html() function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Question .html() function" Watch "Question .html() function" New topic
Author

Question .html() function

Naveen puttu
Ranch Hand

Joined: Sep 15, 2009
Posts: 88
Hi

I have done something like this



How would i get the html value (someBlah here in this case) has been set to the anchor tag .
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I have no clue what you are asking.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65




t3rms? Really?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Naveen puttu
Ranch Hand

Joined: Sep 15, 2009
Posts: 88
The above code would generate

I want to get that string "someBlah" and do fiddle with that value
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Already answered.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Are you fiddling with it when you are adding it to the page? Shouldn't you already have the value at that point since you are adding it in?

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

True, but in most functionally-oriented jQuery-using code, it's unlikely that a reference to the content would be maintained anywhere.
Naveen puttu
Ranch Hand

Joined: Sep 15, 2009
Posts: 88
thanks bear and eric
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question .html() function
 
Similar Threads
jQuery advantages over javascript
focusing on an input element with jquery
jQuery- Verify I selected right element and i am unable to remove it?
Not able to add submit button in HTML using jquery
How to check canvas is empty or not in javascript