i want to call a function from an external file but it shows it is undefined what i tried so far is
index.html file
<button class="btn btn-primary" onclick="check()" >click</button>
script.js file
$(document).ready(function(){
function check()
{
alert('checked');
}
});//document ready function
I would like to call the javascript file onClick of a button in the index.html.when i clicked on click button it shows check is not defined.what is the problem