AnsweredAssumed Answered

Need some help - 'Insert Raw HTML' - 'Submit' button not working.

Question asked by Bunty Alex on Dec 11, 2014
Latest reply on Dec 11, 2014 by wroot

Hello experts,

 

I have wrote a simple code (HTML+JS) as below.

<!DOCTYPE html>
<html>
<body>

<p> Entity</p>

<input id="numb">

<button type="button" onclick="myFunction()">Submit</button>

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

<script>

function myFunction() {
    var x, text;

    // Get the value of input field with id="numb"
    x = document.getElementById("numb").value;

    
    if (x == 1234 || x == 5685) {
       text = "Access Key is 'jdjdj3548'";
    }  else if ( x ==  5678 || x ==  8769) {
 text = "Access Key is 'jyjyj5692'";
    }  else {
       text = "Entity";
    }
 document.getElementById("demo").innerHTML = text;
}
</script>

</body>
</html>

I inserted the code directly into a Blog Post with 'Insert Raw HTML'. When I Publish the blog, 'Submit' button doesn't do anything.

 

I checked the same code in W3Schools HTML and Submit button works perfectly fine.

 

Any idea what might be causing the problem?

 

TIA.

Outcomes