<p onclick="play()">abc</p>
js
function play(){
do something;
}
The above works if js code is in the same file as p
But saying:
<script src="index.js"></script>
index.js
$(document).ready( function() {
function play() {
do something;
}
});
What i get is ReferenceError: play is not defined
Other functions, except play()
works well.