One way is to use a ternary operator which works as a single line if statement in JavaScript. This is the best way, let's see the example.
確定! 回上一頁