<form>
  <input type="number" onchange="changeiput(event)">
  <input type="text" style="display:none;">
  <p>入力した数字は<span></span>です。</p>
</form>
body{
  display:flex;
  flex-flow:column nowrap;
  align-items:center;
}

form{
  width:160px;
  font-size:12px;
}

input,p{
  width:100%;
}

input{
  font-size:24px;
}

p > span{
  font-size:18px;
  color:#ff0000;
}
let meytext = document.querySelector("p>span");

let changeiput = (e)=>{  
  if (e.currentTarget.value == "") return meytext.textContent = ""
  if (e.currentTarget.value % 2 == 0) return meytext.textContent = "偶数"
  
  return meytext.textContent = "奇数";
}

/*
let changeiput = (e)=>{  
  if (e.currentTarget.value % 2 == 0) {
    meytext.textContent = "偶数"
  }else{
    meytext.textContent = "奇数";
  }
}
*/

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.