I need to add in some javascript code onto my page after an onclick. I have the following code but nothing happens on the button click and the page just outputs:
'); }); }); [button]
Here is my code:
<button type="submit" id="btn">button</button>
<div id="code"></div>
<script>
jQuery(document).ready(function () {
jQuery('#btn').click(function(){
jQuery('#code').append('<script>alert("WORKING");</script>');
});
});
</script>