2

I have a JSFiddle I'm making, and the onclick event is not firing. It's probably just something simple that I'm missing, can anyone help?

JavaScript:

var out = document.getElementById("currentOut");
var oldout = document.getElementById("output");
var input = document.getElementById("PXInput");
var cc = "";

    function submit(){
        alert();
        cc = input.value;
    input.value = "";
    alert(cc);
}

HTML:

<textarea id="PXInput"></textarea>
<br/>
<button id="submitLine" type="button" onclick="submit()">Submit</button>
<div id="output">
    <span id="currentOut"></span>
</div>

https://jsfiddle.net/cwoe1s0u/4/

Feathercrown
  • 2,547
  • 1
  • 16
  • 30

1 Answers1

1

You should change javascript Load Type to "No Wrap - in body".

Nemanja Todorovic
  • 2,521
  • 2
  • 19
  • 30