I want to call the function that is in another function in my HTML file here is my HTML code:
<input type="radio" name="layerButton" value="UnTiled" id="raster" onclick="if(this.checked){myFunction()}">Raster Layer
<script type="text/javascript" src="./main.js" ></script>
and here is my javascript code(main.js):
function init(){
function myFunction() {
alert('hi')
}
}
and error is :
Uncaught ReferenceError: myFunction is not defined