I have several inline jqueries, how can I move them into one single external .js file?
Below are the inline functions I created using JQuery
Inline Functions:
$(document).ready(function(){
$("#showReport").click(function() {
var val = $('input:radio[name=reportOption]:checked').val();
if(val == 'frame'){
document.getElementById("form").target = '_self';
}
else{
document.getElementById("form").target = '_blank';
}
if(document.form.fromDate.value=='' || document.form.toDate.value==''){
alert("Please enter Date Range");
}
else{
document.form.submit();
}
})
});
Well, you just save that function to a js file called
javascript.js, put that file in the same directory of your html file and writeAt the end of your html file (just before your closing
</body>tag)