I want to get all function code (with parameters) and print it in div.code
html file
<script src='script.js'></script>
...
<input type=text value='text' id='my_input'>
<div class='code'></div>
<script>
document.querySelectorAll('div.code')[0].innerHTML=func(document.getElementById('my_input'));
</script>
script.js
function func(param){
console.log(param);
}
So in div.code it should be
"function func(text){
console.log(text)
}"
What should I use to do it ? I tried to use toString, toSource, JSON.stringify but it does not work