Your questions are a bit far cry for a full explanation on a short Q & A site such as SA. You really need to read a lot of material for a complete understanding.
However, some brief simplified answers to get started
1) HTML links to JavaScript through events that trigger JavaScript functions. This is an example of a very simple event in an HTML element that will look for a function in your JavaScript declared as function aJavaScriptFunction(){ } when you click on the button. There are different ways to do this and different types of events, but this is a good place to start.
<input id="thebutton" type="button" value="A Button" onclick="aJavaScriptFunction();" />
2) It very much depends on what you are trying to do, but in general, selecting HTML DOM elements through their identifier is an effective method of choosing them to do something with them. So it could be the JavaScript function that we use in the previous example.
function aJavaScriptFunction() { var aButtonElement = document.getElementById("thebutton");
3) No. JavaScript and CSS do not actually overlap as directly as you think when you start thinking of them as changing HTML. You can do some of the same things with JavaScript as CSS, but in general they happen at different times. This CSS does not conflict with previous JavaScript, although both of them do similar things.
#thebutton { border-color: blue; }
Here are all my examples compiled in jsFiddle where you can play with them.
You'd better go somewhere like W3 Schools or Code Academy .
Klors source share