Try it
Javascript
Jquery
Angular
Learn Angular
Learn Javascript
Learn Bootstrap
Learn jQuery
ConditionalOperator-2
Conditional Operator
?
with multiple conditions.
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <p id="sample"></p> <script> var firstCheck = false, secondCheck = false, access = firstCheck ? "Access denied" : secondCheck ? "Access denied" : "Access granted"; document.getElementById("sample").innerHTML = access; </script> </body> </html>
Output
×
Save This try
Title
Description
<p>Conditional Operator <code>?</code> with multiple conditions.</p>