How to compare multiple words separated by comma in an if statement?
<p>I have a variable named title which is having the value "Javascript,XML,XHTML,CSS,Ajax". I need to compare in an if statement if the title equals to the above value some code needs to be run.</p>

<p>I have used </p>

<pre><code>if (title == "Javascript,XML,XHTML,CSS,Ajax"){

} else if (title == " ") {

} else {

}
</code></pre>

<p>When the title is null, the code goes to the second <code>else</code> part and gets the correct result. But when the title is equal to Javascript,XML,XHTML,CSS,Ajax the code goes to the last <code>else</code> part instead of going to the <code>if</code> part.</p>

<p>What mistake have I done here? I have checked the upper lower case and also spelling along with the delimiter comma the string is same just as in the variable title. Then why do I not get the correct answer.</p>
