if(a==0){

//処理

}

else if(a==1){

//

}

else{

//処理

}

-----------js-------------

function test3(el){
var count=el.innerHTML.length;
var text=count+"文字で、";
if(count%2==0){
text+="偶数で";
}
else{
text+="偶数で";
}
if(count%3==0){
text+="3の倍数で";
}
text+="す。";
alert(text);
}

-----------js-------------


-----------HTML-------------


<button onclick="test3(this);">ここの文字数が何文字か取得する。</button>


-----------HTML-------------