First of all please ignore if this question if seems stupid as I am not that much good in javascript side.
I need to call a function inside another function on document load. An example code is below. Here I need to alert the message 'my second alert'. How can I make it happen?. I know by initializing alertSecond()
inside the function will work it, but is there any other way to do it?
Thanks in advance
$(document).ready() {
test();
function test() {
alert('my first alert');
function alertSecond() {
alert('my second alert')
}
}
}