js中,三元运算的简单应用(?:)

js中,三元运算的简单应用:

var sinOrMul = "";

sinOrMul =(subType=="single")?("<span class='quesType'>单选题</span>"):("<span class='quesType'>多选题</span>");

posted @ 2017-04-17 21:39  小码农成长记  阅读(470)  评论(0编辑  收藏  举报