Error when get value in <ul><li>
<pre><code>&lt;div class="heading"&gt;
&lt;ul&gt;
&lt;li id="one"&gt;One&lt;/li&gt;
&lt;li id="two"&gt;Two&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>I using this jquery</p>

<pre><code>&lt;script&gt;
$(document).ready(function(){
    $('.heading ul li').click(function(){
        var type1 = $('#one').val();
        var type2 = $('#two').val();
        if(type1) {
            alert("1");
        } else {
            alert("2");
        }
    });    
});
&lt;/script&gt;
</code></pre>

<p>=> Error when click on One or Two, result is 2, too , how to fix it ?</p>
