Exercise 2: Basic Dom Scripting
So far, we have created JavaScript by hooking the code to a button etc. A
good way to learn jQuery (and JavaScript) is to try things in the console.
So open the Developer Tools (F12) and try to accomplish the following
tasks.
How would you:
- Find a reference to all H3 -tags?
-
Find a reference to div with an id='contant' and replace the contents
with a text of your choice else?
-
Find a reference to the img and replace the src attribute with some
other image online?
- Find the element with a class sideBarListBox and show/hide it?
-
Find any li element that contains the text "Lorem" and add css
underline -attribute to them?
-
Find all the anchor tags within the class SideBarListBox and apply css
modifications of your choice to them.