<!DOCTYPE html>
<html>
<head>
<title>三元运算</title>
</head>
<body>
<script type="text/javascript">
// (条件) ? run this code : run this code;
var isresult = 1 > 2 ? '真的' : '假的';
alert(isresult);
</script>
</body>
</html>