The main use of Javascript in the web browser is its ability to create dynamic and interactive webpages. So far, we’ve been looking at HTML and CSS, and you’ve probably noticed that the content is static: the browser will display all the elements that were defined within the HTML file, with the CSS styles applied to them, and nothing else. There is no way for a website’s content to change dynamically (e.g. in response to a user action) by simply using HTML and CSS. We need Javascript for that.
html()
)css()
and addClass()
)appendTo
, remove
)