test of if/else conditionals and ternary operator using JS and HTML