Get value of child div using jquery

Total Post:45

Points:323

JQuery 
 799  View(s)
Ratings:
Rate this:

I want to access the content of div id second ..please help
<div id='container'>
    <div id='first'>first text</div>
    <div id='second'>Secod text</div>
    <div id='third'>Third test</div>
</div>
thanks in advance
  1. Re: Get value of child div using jquery

    //To get the textual contents of a container, you need to use text() (or html(),

       
    var text_val = $('#second').text(); 
        or
     
        var text_val = $('#container').children('#second').text();

    hope this will helps you..

      Modified On Apr-11-2018 11:07:28 PM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.