In html, i have 2 links with different ids. When i click on both the id's the code enters the first condition of the "If" loop. Any idea what's wrong?
Html:
<ul class="megamenu-list menuapp">
<li class="title">Types</li>
<li><a href="app.html" id="sop">SOP</a></li>
<li><a href="app.html" id="tpc">TPC</a></li>
</ul>
My jquery script:
$(document).ready(function(){
var $appload;
$(".menuapp li a").click(function(){
$appload = $(this).attr('id');
alert($appload);
});
if($appload ="tpc"){
alert("insop"); //in both cases the code enters this condition.
$("#dynamic").load("app/sop.html");
}
else if ($appload ="sop"){
alert($appload);
alert(" intpc");
$("#dynamic").load("app/tpc.html");
}
});