Compare two values for equality - Javascript Operator

Javascript examples for Operator:Comparison Operators

Description

Compare two values for equality

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/*  w  ww. j  ava  2s . co m*/
    var x = 10;
    var y = 5;
    x = y;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials