I'm realy new at HTML and JS, so my question may sound dumb: I can't make my HTML code recognise and run my js code! no matter what I do, it doesn't seem that my HTML file find my js file, of if it does - it doesn't do anything.
I'm working on a page as a project, but because the js doesn't work I try to open a simple HTML file with a simple js - but it still doesn't do anything.
my questions are:
what js function can I use just to see that the HTML file finds the js file and everything is working fine?
this is my html simple code:
<!DOCTYPE html> <head> <link rel="stylesheet" type="text/css" href="C:\Users\User\Dropbox\WEB\js\try.css"> <script type="text/javascript" src = "C:\Users\User\Dropbox\WEB\js\scripts.js"></script> </head> <div>hi there</div> <div>bye there</div> </html>
the html and the js file are both in the same folder. The html recognise and reacts to the css file.
this is the js code:
$(document).ready(function(){
var name = prompt("name?");
console.log(name);
$('div').click(function(){
$('div').fadeOut('slow');
});
});
yet when I opne the html file with chrome - nothing happens, not when I open and not when I click the div element.
so, what am I doing wrong? do experianced html\js developers can give me some tips on how to prevent this thing from happening in the future?
thx, Yishai