(вангую, что на самом деле хотели сделать)
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
:disabled{
background-color: #FF0000;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
$("#abc").on("input", function() {
var l1 = $("#lol").val();
var l2 = $("#lol2").val();
$("#but").prop('disabled', l1 == l2);
}).trigger("input");
});
</script>
</head>
<body>
<form id="abc">
<input type="text" id= 'lol' value='test'>
<input type="text" id='lol2' value='test'>
<input type="button" id='but' >
</form>
</body>
</html>