How can use AND statement in if with javascript?
<p>Hello everyone I'm trying to run multiple javascripts and use AND statement. When user click an option which has value="1986" and click other option which has value="3", some text will appear. I have used AND statement in if statement but it doesn't work. Here is my code :</p>

<pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"&gt;&lt;/script&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
$(document).ready(function() {

    $('#main').on('change', '.select-box', function() {

        if ($(".select-box option[value='3']").attr('selected') &amp; $(".select-box option[value='1986']").attr('selected')) {

            $('#demo').html("Hello World");

        }



    });

});
    &lt;/script&gt;
&lt;script type="text/javascript"&gt;

var x="",i;
for(i=1986;i&lt;2013;i++)
{
x=x + "&lt;option value='"+i+"'&gt; " + i + "&lt;/option&gt;";
}
$(document).ready(function() {
document.getElementById("demo2").innerHTML="&lt;select class='select-box'&gt;"+x+"&lt;/select&gt;";
});
&lt;/script&gt;


&lt;/head&gt;
&lt;body&gt;  
    &lt;p id="demo2"&gt;&lt;/p&gt;
    &lt;div id="main"&gt;
&lt;select class="select-box"&gt;
      &lt;option value="0"&gt;alert&lt;/option&gt;
      &lt;option value="1"&gt;alert to&lt;/option&gt;
      &lt;option value="2"&gt;no alert&lt;/option&gt;
      &lt;option value="3"&gt;best alert&lt;/option&gt;
    &lt;/select&gt; 
&lt;p&gt;&lt;br/&gt;
    &lt;div id="demo"&gt;&lt;/div&gt;

    &lt;/div&gt;


    &lt;/body&gt;
</code></pre>
