Css Selector ans.txt
12) div>span
13) .orderedList>li
14) ol>li>ol>li
15) input:required
16) input[type=password]
17) div:nth-child(-n+2)
18) div:nth-child(-n+2)
19) b[title*="middle"]
20) p:not(:last-child)
21) p:not(:first-child):nth-last-child(odd)
22) b:nth-last-child(odd)
23) tr:first-of-type td:first-of-type,tr:first-of-type+tr td:first-of-type+td,tr:first-of-type+tr+tr td:first-of-type+td+td
24) p:first-of-type
25) p:last-child
26) p:first-child:nth-last-child(1)
27) p:first-child,p:last-child
28) p:nth-child(2n+2)
29) p:nth-child(2n+1)
30) p:first-of-type
31) p:nth-last-child(3)
32) div:nth-last-child(2)
33) :not(#not_me)
34) p:not(.someClass)
35) input:required
36) tr:nth-of-type(1)>:nth-child(1),tr:nth-of-type(2)>:nth-child(2),tr:nth-of-type(3)>:nth-child(3)
DOM answers.txt
1. Buttons are used for actionable events , as we are prompting alert box(which is used to prompt a message) onClick of the button "Hello World!" message displayed on alert box.
2. Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0100
3. Commented the unnecessary block availble in script file which also contains } , can cause issues in script. After commenting the unnecessary code, found two alerts one shows button object as we are sending buttonobject as input using this and another alert with value of button which is "Hello World!"
4. Added alert("Hello"); in alert_experiment_2 method to get alert with Hello.
5. Created below function to get required alert
function read_attribute_experiment(object)
{
alert(object.getAttribute("class"));
}
6. Defined onlick event on the tag and added below code to assign class and added alert to show the assigned class.
Write Tag Attribute Experiment 7. Defined onClick event and added below code to replace inner html content.
innerHTML Experiment