How to get span tag inside a div in jQuery and assign a text?

Posted by bala3569 on Stack Overflow See other posts from Stack Overflow or by bala3569
Published on 2010-04-20T06:36:53Z Indexed on 2010/04/20 6:43 UTC
Read the original article Hit count: 563

Filed under:
|
|

I use the following ,

<div id='message' style="display: none;">
  <span></span>
 <a href="#" class="close-notify">X</a>
</div>

Now i want to find the span inside the div and assign a text to it...

function Errormessage(txt) {
    $("#message").fadeIn("slow");
    // find the span inside the div and assign a text
    $("#message a.close-notify").click(function() {
        $("#message").fadeOut("slow");
    });
}

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about find