JSFiddle - React, Tailwind, and code Playground
by pphheerroonn
HTML
<script type="text/javascript">// <![CDATA[
function validateSerial() {
var x = document.getElementById("serialn").value;
if (x.length > 10) {
document.getElementById("stage2").style.display = "block";
document.getElementById("stage1").style.display = "none";
document.getElementById("error").style.display = "none";
}
else{
document.getElementById("error").style.display = "block";
}
}
// ]]></script>
<div id="stage1">
<input id="serialn">
<button type="button" onclick="validateSerial()">Submit</button>
</div>
<div id="stage2" style="display:none;">
<p>
This is stage 2
</p>
</div>
<div id="stage2" style="display:none;">
<p>
Error message!
</p>
</div>