How can i find previous class using jQuery? : I want to get previous tag value with id but when I click on three then got value & when I click on four and five didn't get.

How can I get it?

This is what i tried:-

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

     $(document).ready(function(){
          $('ul li').click(function(){
             alert($(this).prev('.two').text());
          });
       });

<!-- language: lang-html -->

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

        <ul>
            <li>One</li>
            <li class="two">Two</li>
            <li>Three</li>
            <li>Four</li>
            <li>Five</li>
        </ul>

<!-- end snippet -->


The answer will be appreciated!